提交 dbe5c849 编写于 作者: D DCloud_LXH

chore: mp-plugin call_hook

上级 499fa577
......@@ -10,17 +10,17 @@ export default function createPlugin (vm) {
const appOptions = parseApp(vm)
if (isFn(appOptions.onShow) && __GLOBAL__.onAppShow) {
__GLOBAL__.onAppShow((...args) => {
appOptions.onShow.apply(vm, args)
vm.__call_hook('onShow', args)
})
}
if (isFn(appOptions.onHide) && __GLOBAL__.onAppHide) {
__GLOBAL__.onAppHide((...args) => {
appOptions.onHide.apply(vm, args)
vm.__call_hook('onHide', args)
})
}
if (isFn(appOptions.onLaunch)) {
const args = __GLOBAL__.getLaunchOptionsSync && __GLOBAL__.getLaunchOptionsSync()
appOptions.onLaunch.call(vm, args)
vm.__call_hook('onLaunch', args)
}
return vm
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册