提交 dfd146c2 编写于 作者: fxy060608's avatar fxy060608

fix(mp-baidu): onInit (#3384)

上级 a5be708b
......@@ -14,6 +14,8 @@ import {
ON_THEME_CHANGE,
ON_UNHANDLE_REJECTION,
ON_SHARE_APP_MESSAGE,
ON_INIT,
ON_READY,
} from '@dcloudio/uni-shared'
export interface CustomAppInstanceProperty extends Record<string, any> {
......@@ -70,8 +72,11 @@ export function parseApp(
const vueOptions = instance.$.type as ComponentOptions
initHooks(appOptions, HOOKS)
initUnknownHooks(appOptions, vueOptions)
if (__PLATFORM__ === 'mp-baidu') {
initUnknownHooks(appOptions, vueOptions, [ON_INIT, ON_READY])
} else {
initUnknownHooks(appOptions, vueOptions)
}
if (__VUE_OPTIONS_API__) {
const methods = vueOptions.methods
methods && extend(appOptions, methods)
......
......@@ -50,6 +50,8 @@ export const ON_UNHANDLE_REJECTION = 'onUnhandledRejection'
export const ON_LOAD = 'onLoad'
export const ON_READY = 'onReady'
export const ON_UNLOAD = 'onUnload'
// 百度特有
export const ON_INIT = 'onInit'
export const ON_RESIZE = 'onResize'
export const ON_BACK_PRESS = 'onBackPress'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册