Skip to content

Commit

Permalink
recompose
Browse files Browse the repository at this point in the history
  • Loading branch information
caominjie committed Oct 30, 2018
1 parent 10427c6 commit 74034bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/mpvue/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4947,10 +4947,6 @@ function callHook$1 (vm, hook, params) {
handlers = [handlers];
}

if (hook = 'onPageNotFound' && handlers) {
handlers = [handlers];
}

var ret;
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
Expand Down Expand Up @@ -5164,10 +5160,6 @@ function initMP (mpType, next) {

onError: function onError (err) {
callHook$1(rootVueVM, 'onError', err);
},

onPageNotFound: function onPageNotFound (err) {
callHook$1(rootVueVM, 'onPageNotFound', err)
}
});
} else if (mpType === 'component') {
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/mp/runtime/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export function callHook (vm, hook, params) {
let handlers = vm.$options[hook]
if (hook === 'onError' && handlers) {
handlers = [handlers]
} else if (hook === 'onPageNotFound' && handlers) {
handlers = [handlers]
}

let ret
Expand Down Expand Up @@ -225,6 +227,10 @@ export function initMP (mpType, next) {

onError (err) {
callHook(rootVueVM, 'onError', err)
},

onPageNotFound (err) {
callHook(rootVueVM, 'onPageNotFound', err)
}
})
} else if (mpType === 'component') {
Expand Down

0 comments on commit 74034bf

Please sign in to comment.