mirror of https://github.com/nuxt/nuxt.git
Compare commits
4 Commits
83813f9cff
...
d355e4bdd4
Author | SHA1 | Date |
---|---|---|
Ryota Watanabe | d355e4bdd4 | |
Ryota Watanabe | 0e4d0d5d63 | |
autofix-ci[bot] | 0ef7f8d46f | |
wattanx | a340ebd13d |
|
@ -244,6 +244,19 @@ const plugin: Plugin<{ router: Router }> = defineNuxtPlugin({
|
||||||
await nuxtApp.callHook('page:loading:end')
|
await nuxtApp.callHook('page:loading:end')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
router.afterEach(async (to, _from) => {
|
||||||
|
if (to.matched.length === 0) {
|
||||||
|
await nuxtApp.runWithContext(() => showError(createError({
|
||||||
|
statusCode: 404,
|
||||||
|
fatal: false,
|
||||||
|
statusMessage: `Page not found: ${to.fullPath}`,
|
||||||
|
data: {
|
||||||
|
path: to.fullPath,
|
||||||
|
},
|
||||||
|
})))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
nuxtApp.hooks.hookOnce('app:created', async () => {
|
nuxtApp.hooks.hookOnce('app:created', async () => {
|
||||||
try {
|
try {
|
||||||
// #4920, #4982
|
// #4920, #4982
|
||||||
|
|
Loading…
Reference in New Issue