mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +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 nuxtApp = useNuxtApp()
|
||||
|
||||
onErrorCaptured((err) => {
|
||||
onErrorCaptured((err, target, info) => {
|
||||
if (process.client && !nuxtApp.isHydrating) {
|
||||
emit('error', err)
|
||||
nuxtApp.hooks.callHook('vue:error', err, target, info)
|
||||
error.value = err
|
||||
return false
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ export default defineComponent({
|
||||
const nuxtApp = useNuxtApp()
|
||||
nuxtApp.hook('page:start', indicator.start)
|
||||
nuxtApp.hook('page:finish', indicator.finish)
|
||||
nuxtApp.hook('vue:error', indicator.finish)
|
||||
onBeforeUnmount(indicator.clear)
|
||||
|
||||
return () => h('div', {
|
||||
|
Loading…
Reference in New Issue
Block a user