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