Skip to content

Commit 74034bf

Browse files
author
caominjie
committed
recompose
1 parent 10427c6 commit 74034bf

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/mpvue/index.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4947,10 +4947,6 @@ function callHook$1 (vm, hook, params) {
49474947
handlers = [handlers];
49484948
}
49494949

4950-
if (hook = 'onPageNotFound' && handlers) {
4951-
handlers = [handlers];
4952-
}
4953-
49544950
var ret;
49554951
if (handlers) {
49564952
for (var i = 0, j = handlers.length; i < j; i++) {
@@ -5164,10 +5160,6 @@ function initMP (mpType, next) {
51645160

51655161
onError: function onError (err) {
51665162
callHook$1(rootVueVM, 'onError', err);
5167-
},
5168-
5169-
onPageNotFound: function onPageNotFound (err) {
5170-
callHook$1(rootVueVM, 'onPageNotFound', err)
51715163
}
51725164
});
51735165
} else if (mpType === 'component') {

src/platforms/mp/runtime/lifecycle.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export function callHook (vm, hook, params) {
1212
let handlers = vm.$options[hook]
1313
if (hook === 'onError' && handlers) {
1414
handlers = [handlers]
15+
} else if (hook === 'onPageNotFound' && handlers) {
16+
handlers = [handlers]
1517
}
1618

1719
let ret
@@ -225,6 +227,10 @@ export function initMP (mpType, next) {
225227

226228
onError (err) {
227229
callHook(rootVueVM, 'onError', err)
230+
},
231+
232+
onPageNotFound (err) {
233+
callHook(rootVueVM, 'onPageNotFound', err)
228234
}
229235
})
230236
} else if (mpType === 'component') {

0 commit comments

Comments
 (0)