12 lines
238 B
TypeScript
12 lines
238 B
TypeScript
import router from './index'
|
|
import { useGlobalStore } from '@/stores/global'
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
useGlobalStore().setViewLoading(true)
|
|
next()
|
|
})
|
|
|
|
router.afterEach(() => {
|
|
useGlobalStore().setViewLoading(false)
|
|
})
|