添加系统绑的功能
This commit is contained in:
@@ -25,7 +25,6 @@ export const useNavTabs = defineStore(
|
||||
})
|
||||
|
||||
function addTab(route: RouteLocationNormalized) {
|
||||
console.log('🚀 ~ addTab ~ route:', route)
|
||||
if (!route.meta.addtab) return
|
||||
for (const key in state.tabsView) {
|
||||
if (state.tabsView[key].path === route.path) {
|
||||
@@ -69,7 +68,7 @@ export const useNavTabs = defineStore(
|
||||
}
|
||||
|
||||
const setTabsViewRoutes = (data: RouteRecordRaw[]): void => {
|
||||
state.tabsViewRoutes = encodeRoutesURI(data)
|
||||
state.tabsViewRoutes = encodeRoutesURI(JSON.parse(JSON.stringify(data)))
|
||||
}
|
||||
|
||||
const setAuthNode = (key: string, data: string[]) => {
|
||||
@@ -87,9 +86,9 @@ export const useNavTabs = defineStore(
|
||||
const refresh = () => {
|
||||
// setTimeout(() => {
|
||||
// console.log(123, state.tabsViewRoutes)
|
||||
|
||||
|
||||
let list = matchAndReturnRouteData(state.tabsViewRoutes, state.tabsView)
|
||||
state.tabsView = []
|
||||
state.tabsView = []
|
||||
list.forEach(item => {
|
||||
addTab(item)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user