|
|
@@ -29,11 +29,11 @@ const initAppRouterState: ROUTER.RouterRecords = {
|
|
|
}
|
|
|
}
|
|
|
export const useAppRouter = defineStore(ConstantStore.ROUTER, () => {
|
|
|
- let appRouter = reactive<ROUTER.RouterRecords>(initAppRouterState)
|
|
|
+ const appRouter = reactive<ROUTER.RouterRecords>(initAppRouterState)
|
|
|
|
|
|
- const [appRouterState, setAppRouterState] = useLocalStorageState<ROUTER.RouterRecords>(AppRouterEnum.ROUTER, {
|
|
|
- defaultValue: initAppRouterState
|
|
|
- })
|
|
|
+ // const [appRouterState, setAppRouterState] = useLocalStorageState<ROUTER.RouterRecords>(AppRouterEnum.ROUTER, {
|
|
|
+ // defaultValue: initAppRouterState
|
|
|
+ // })
|
|
|
|
|
|
console.log(RootRouter)
|
|
|
|
|
|
@@ -51,7 +51,7 @@ export const useAppRouter = defineStore(ConstantStore.ROUTER, () => {
|
|
|
|
|
|
appRouter.sider.route = siderRoutes.value!
|
|
|
|
|
|
- setAppRouterState(appRouter)
|
|
|
+ // setAppRouterState(appRouter)
|
|
|
}
|
|
|
|
|
|
const changeNavbar = (path: string) => {
|
|
|
@@ -69,12 +69,12 @@ export const useAppRouter = defineStore(ConstantStore.ROUTER, () => {
|
|
|
selectPath: RootRouter.currentRoute.value.path,
|
|
|
openKeys: RootRouter.currentRoute.value.matched.map(item => item.path)
|
|
|
}
|
|
|
- setAppRouterState(appRouter)
|
|
|
+ // setAppRouterState(appRouter)
|
|
|
emitter.emit(Emitter.NAVBAR)
|
|
|
}
|
|
|
)
|
|
|
|
|
|
- appRouter = appRouterState.value as ROUTER.RouterRecords
|
|
|
+ // appRouter = appRouterState.value as ROUTER.RouterRecords
|
|
|
|
|
|
if (appRouter.navbar.route.length === 0) {
|
|
|
initAppRouter()
|