refactor(projects): 动态路由权限完善

This commit is contained in:
Soybean
2022-04-29 02:00:51 +08:00
parent 401f0c748d
commit 55ddc9cab0
36 changed files with 406 additions and 717 deletions

View File

@ -1,7 +1,7 @@
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router';
import { defineStore } from 'pinia';
import { useRouterPush } from '@/composables';
import { getTabRoutes } from '@/utils';
import { getTabRoutes, clearTabRoutes } from '@/utils';
import { useThemeStore } from '../theme';
import { getTabRouteByVueRoute, isInTabRoutes, getIndexInTabRoutes } from './helpers';
@ -38,6 +38,11 @@ export const useTabStore = defineStore('tab-store', {
}
},
actions: {
/** 重置Tab状态 */
resetTabStore() {
clearTabRoutes();
this.$reset();
},
/**
* 设置当前路由对应的页签为激活状态
* @param path - 路由path