diff --git a/docs/migration-to-vue3.md b/docs/migration-to-vue3.md index e23ba1ffe4bad4579863cdc32793492f67d47090..149d4e17a3b72f3043a017355b1b086cd7e357d4 100644 --- a/docs/migration-to-vue3.md +++ b/docs/migration-to-vue3.md @@ -289,40 +289,42 @@ - 在 Vue3 组合式 API 中,也需要遵循 uni-app 生命周期钩子规范, 如 onLaunch 等应用生命周期仅可在 App.vue 中监听,使用中请注意生命周期钩子的适用范围。[查看全部生命周期钩子](https://uniapp.dcloud.net.cn/collocation/frame/lifecycle) - 只能在 `setup()` 方法或 ` - ``` - - ```js - // 在 + ``` + + ```js + // 在 + ``` - onLaunch(() => { - console.log("App Launch"); - }); - onShow(() => { - console.log("App Show"); - }); - - ``` \ No newline at end of file + \ No newline at end of file