简体中文
appFramework.bootstrap.before
约 192 字小于 1 分钟
2026-08-10
该钩子发生在应用启动之前。
用途
在应用启动前执行额外的业务动作,包括但不限于以下功能:
- 预加载必要的数据或资源
- 初始化应用设置和配置
- 进行用户引导或提示信息的显示
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| 通用参数 | 详见 | -- |
| options | 应用渲染依赖的参数 | Object |
options
| 参数 | 说明 | 类型 |
|---|---|---|
| appId | 应用 appId | String |
| parameters | 渲染应用第一个菜单页面所依赖的参数 | Array |
| component | 需要渲染的组件名称 | String |
| route | 特殊业务的页面路径(例如:bi) | String |
基础示例
export default class Plugin {
apply() {
return [{
event: 'appFramework.bootstrap.before',
functional: this.bootstrapBefore.bind(this)
}]
}
bootstrapBefore(plugin, { options }) {
console.log(options.appId);
console.log(options.component);
return Promise.resolve();
}
}