1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-01-23 16:10:21 +08:00

fix: 解决vite5循环引用导致热更新失效问题

This commit is contained in:
zclzone
2024-01-06 18:47:40 +08:00
parent c4fd0459ab
commit 2c9604a829
14 changed files with 351 additions and 317 deletions

View File

@@ -0,0 +1,26 @@
/**********************************
* @Author: Ronnie Zhang
* @LastEditor: Ronnie Zhang
* @LastEditTime: 2024/01/06 17:18:40
* @Email: zclzone@outlook.com
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { defineStore } from 'pinia'
export const useRouterStore = defineStore('router', () => {
const router = useRouter()
const route = useRoute()
function resetRouter(accessRoutes) {
accessRoutes.forEach((item) => {
router.hasRoute(item.name) && router.removeRoute(item.name)
})
}
return {
router,
route,
resetRouter,
}
})