mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nuxt): stop loading indicator on vue errors (#20738)
This commit is contained in:
parent
26c6531282
commit
e9b2f6286c
@ -11,9 +11,10 @@ export default defineComponent({
|
|||||||
const error = ref<Error | null>(null)
|
const error = ref<Error | null>(null)
|
||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
|
|
||||||
onErrorCaptured((err) => {
|
onErrorCaptured((err, target, info) => {
|
||||||
if (process.client && !nuxtApp.isHydrating) {
|
if (process.client && !nuxtApp.isHydrating) {
|
||||||
emit('error', err)
|
emit('error', err)
|
||||||
|
nuxtApp.hooks.callHook('vue:error', err, target, info)
|
||||||
error.value = err
|
error.value = err
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ export default defineComponent({
|
|||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
nuxtApp.hook('page:start', indicator.start)
|
nuxtApp.hook('page:start', indicator.start)
|
||||||
nuxtApp.hook('page:finish', indicator.finish)
|
nuxtApp.hook('page:finish', indicator.finish)
|
||||||
|
nuxtApp.hook('vue:error', indicator.finish)
|
||||||
onBeforeUnmount(indicator.clear)
|
onBeforeUnmount(indicator.clear)
|
||||||
|
|
||||||
return () => h('div', {
|
return () => h('div', {
|
||||||
|
Loading…
Reference in New Issue
Block a user