mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-10 20:36:55 +08:00
add loadingbar
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useProviderStore } from '@/store/useProviderStore'
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
|
||||
import IndexView from '../views/IndexView.vue'
|
||||
|
||||
@@ -355,5 +356,13 @@ const router = createRouter({
|
||||
history: createWebHistory(process.env.BASE_URL),
|
||||
routes,
|
||||
})
|
||||
router.beforeEach((to, from, next) => {
|
||||
useProviderStore().loadingBar?.start()
|
||||
next()
|
||||
})
|
||||
router.afterEach((to, from) => {
|
||||
const loadingBar = useProviderStore().loadingBar
|
||||
loadingBar?.finish()
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user