Window 对象的扩展接口 定义了低代码平台在 Window 对象上添加的所有属性和方法

interface WindowExtensions {
    appVue: VueConstructor<Vue>;
    Vue: VueConstructor<Vue>;
    VueRouterInstance: typeof VueRouter;
    rendered: (() => Promise<void>);
    beforeRouter: ((event: BeforeRouterEvent) => Promise<void>);
    afterRouter: ((to: Route, from: Route) => Promise<void>);
    preRequest: ((event: PreRequestEvent, data: any) => Promise<any>);
    postRequest: ((event: PostRequestEvent) => Promise<void>);
    appInfo: AppConfig & PlatformConfig;
    $global: LcapGlobal;
    $mixins: LcapMixins;
    $logics: Record<string, LcapService>;
    $service: Record<string, LcapService>;
    $auth: LcapAuth;
    $utils: LcapUtils;
    $genInitFromSchema: GenInitFromSchema;
    $i18n: typeof VueI18n;
    $destination: ((url: string, target?: string, replace?: boolean) => void);
    $link: ((url: string, target?: string) => void);
    $sleep: ((ms: number) => Promise<void>);
    LcapMicro?: {
        routePrefix: string;
        container: HTMLElement;
    };
}

Properties

appVue: VueConstructor<Vue>

Vue.js 应用实例

Vue: VueConstructor<Vue>

Vue.js 构造函数

VueRouterInstance: typeof VueRouter

Vue Router 实例

rendered: (() => Promise<void>)

应用渲染完成事件

beforeRouter: ((event: BeforeRouterEvent) => Promise<void>)

路由跳转前事件

afterRouter: ((to: Route, from: Route) => Promise<void>)

路由跳转后事件

preRequest: ((event: PreRequestEvent, data: any) => Promise<any>)

请求发送前事件

postRequest: ((event: PostRequestEvent) => Promise<void>)

请求完成后事件

应用和平台配置信息

$global: LcapGlobal

全局状态和方法

$mixins: LcapMixins

全局混入对象

$logics: Record<string, LcapService>

业务逻辑服务集合

$service: Record<string, LcapService>

API 服务集合

$auth: LcapAuth

权限服务

$utils: LcapUtils

工具函数集合

$genInitFromSchema: GenInitFromSchema

从 Schema 生成初始化数据的函数

$i18n: typeof VueI18n

国际化实例

$destination: ((url: string, target?: string, replace?: boolean) => void)

页面跳转函数

$link: ((url: string, target?: string) => void)

链接跳转函数

$sleep: ((ms: number) => Promise<void>)
LcapMicro?: {
    routePrefix: string;
    container: HTMLElement;
}

微前端配置(可选)

Type declaration

  • routePrefix: string

    路由前缀

  • container: HTMLElement

    容器元素