mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
fix(nuxt): only remove one item from middleware (#21730)
This commit is contained in:
parent
6b8cb97d54
commit
c72bc95473
@ -45,7 +45,10 @@ export default defineComponent({
|
|||||||
nuxtApp.hook('page:finish', indicator.finish)
|
nuxtApp.hook('page:finish', indicator.finish)
|
||||||
nuxtApp.hook('vue:error', indicator.finish)
|
nuxtApp.hook('vue:error', indicator.finish)
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
globalMiddleware.splice(globalMiddleware.indexOf(indicator.start, 1))
|
const index = globalMiddleware.indexOf(indicator.start)
|
||||||
|
if (index >= 0) {
|
||||||
|
globalMiddleware.splice(index, 1)
|
||||||
|
}
|
||||||
indicator.clear()
|
indicator.clear()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user