fix: 修复挂载路由时使用$loadingBar出错问题
This commit is contained in:
parent
437d87f19e
commit
33aaadba60
@ -13,7 +13,7 @@ async function setupApp() {
|
|||||||
|
|
||||||
await setupRouter(app)
|
await setupRouter(app)
|
||||||
|
|
||||||
app.mount('#app', true)
|
app.mount('#app')
|
||||||
}
|
}
|
||||||
|
|
||||||
setupApp()
|
setupApp()
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
export function createPageLoadingGuard(router) {
|
export function createPageLoadingGuard(router) {
|
||||||
router.beforeEach(() => {
|
router.beforeEach(() => {
|
||||||
$loadingBar.start()
|
window.$loadingBar?.start()
|
||||||
})
|
})
|
||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$loadingBar.finish()
|
window.$loadingBar?.finish()
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
router.onError(() => {
|
router.onError(() => {
|
||||||
$loadingBar.error()
|
window.$loadingBar?.error()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user