Skip to content

Commit

Permalink
feat(core): added other app lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcaufy committed Nov 23, 2018
1 parent 5f2d8b5 commit 33f4c1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/weapp/init/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ export function patchAppLifecycle (appConfig, options, rel) {

return callUserMethod(vm, vm.$options, 'onLaunch', args);
};

['onShow', 'onHide', 'onError', 'onPageNotFound'].forEach(k => {
if (options[k] && isFunc(options[k])) {
appConfig[k] = function (...args) {
return callUserMethod(app, app.$options, k, args);
}
}
});
};

export function patchComponentLifecycle (compConfig, options) {
Expand Down

0 comments on commit 33f4c1f

Please sign in to comment.