提交 dbe5c849 编写于 作者: D DCloud_LXH

chore: mp-plugin call_hook

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