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