Api Reference
API 参考
Section titled “API 参考”createApp(options)
Section titled “createApp(options)”创建一个新的应用实例。
options.name- 应用名称options.version- 版本号options.plugins- 插件列表
返回一个 App 实例。
const app = createApp({ name: 'Demo', plugins: [logger, router]})App 实例方法
Section titled “App 实例方法”app.start()
Section titled “app.start()”启动应用。
app.start()// 输出: App started successfully!app.stop()
Section titled “app.stop()”停止应用。
app.use(plugin)
Section titled “app.use(plugin)”注册插件。
app.use(myPlugin)| 事件名 | 触发时机 |
|---|---|
| ready | 应用就绪 |
| error | 发生错误 |
| destroy | 应用销毁 |