Skip to content

Commit c4f44da

Browse files
authored
Merge pull request #1107 from kailcc/lifecycle-onPageNotFound
fix #1001
2 parents ed2e02f + 74034bf commit c4f44da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)