qdt-admin-layout 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdt-admin-layout",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "基于element-ui的后台管理layout的管家婆改版",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -76,10 +76,14 @@ export const mutations = {
76
76
 
77
77
  const key = getRouterKey(view)
78
78
 
79
- if (store.visitedViews.some(v => v.key === key)) {
79
+ if (store.visitedViews.some(v => v.key === key || v.key === view.meta.mainRoute)) {
80
80
  return
81
81
  }
82
-
82
+ const index = store.visitedViews.findIndex(item => item.fullPath.includes('xsgzt'));
83
+ // 如果存在则删除
84
+ if (index !== -1) {
85
+ store.visitedViews.splice(index, 1);
86
+ }
83
87
  // 增加key属性
84
88
  store.visitedViews.push({ ...view, key })
85
89
  },
@@ -93,7 +97,7 @@ export const mutations = {
93
97
  const { noCache } = view.meta
94
98
  const key = getRouterKey(view)
95
99
 
96
- if (noCache === true || store.cachedViews.includes(key)) {
100
+ if (noCache === true || store.cachedViews.includes(key) || store.cachedViews.includes(view.meta.mainRoute)) {
97
101
  return
98
102
  }
99
103
  store.cachedViews.push(key)