mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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('vue:error', indicator.finish)
|
||||
onBeforeUnmount(() => {
|
||||
globalMiddleware.splice(globalMiddleware.indexOf(indicator.start, 1))
|
||||
const index = globalMiddleware.indexOf(indicator.start)
|
||||
if (index >= 0) {
|
||||
globalMiddleware.splice(index, 1)
|
||||
}
|
||||
indicator.clear()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user