feat:增加设置模块
This commit is contained in:
18
src/App.vue
18
src/App.vue
@@ -1,8 +1,26 @@
|
||||
<template>
|
||||
<app-loading ref="loadingRef"/>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import AppLoading from '@/components/AppLoading.vue'
|
||||
import { useAppStore } from '@/store/app.ts'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const router = useRouter()
|
||||
|
||||
appStore.initApp()
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
appStore.isLoading = true
|
||||
next()
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
appStore.isLoading = false
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user