|
@@ -6,11 +6,12 @@ const state = { |
|
@@ -6,11 +6,12 @@ const state = { |
|
6
|
|
6
|
|
|
7
|
const mutations = {
|
7
|
const mutations = {
|
|
8
|
ADD_IFRAME_VIEW: (state, view) => {
|
8
|
ADD_IFRAME_VIEW: (state, view) => {
|
|
9
|
- if (state.iframeViews.some(v => v.path === view.path)) {
|
|
|
|
10
|
- return
|
|
|
|
11
|
- } else {
|
|
|
|
12
|
- state.iframeViews.push(view)
|
|
|
|
13
|
- }
|
9
|
+ if (state.iframeViews.some(v => v.path === view.path)) return
|
|
|
|
10
|
+ state.iframeViews.push(
|
|
|
|
11
|
+ Object.assign({}, view, {
|
|
|
|
12
|
+ title: view.meta.title || 'no-name'
|
|
|
|
13
|
+ })
|
|
|
|
14
|
+ )
|
|
14
|
},
|
15
|
},
|
|
15
|
ADD_VISITED_VIEW: (state, view) => {
|
16
|
ADD_VISITED_VIEW: (state, view) => {
|
|
16
|
if (state.visitedViews.some(v => v.path === view.path)) return
|
17
|
if (state.visitedViews.some(v => v.path === view.path)) return
|
|
@@ -87,10 +88,12 @@ const mutations = { |
|
@@ -87,10 +88,12 @@ const mutations = { |
|
87
|
if (i > -1) {
|
88
|
if (i > -1) {
|
|
88
|
state.cachedViews.splice(i, 1)
|
89
|
state.cachedViews.splice(i, 1)
|
|
89
|
}
|
90
|
}
|
|
|
|
91
|
+ if(item.meta.link) {
|
|
|
|
92
|
+ const fi = state.iframeViews.findIndex(v => v.path === item.path)
|
|
|
|
93
|
+ state.iframeViews.splice(fi, 1)
|
|
|
|
94
|
+ }
|
|
90
|
return false
|
95
|
return false
|
|
91
|
})
|
96
|
})
|
|
92
|
- const iframeIndex = state.iframeViews.findIndex(v => v.path === view.path)
|
|
|
|
93
|
- state.iframeViews = state.iframeViews.filter((item, idx) => idx <= iframeIndex)
|
|
|
|
94
|
},
|
97
|
},
|
|
95
|
DEL_LEFT_VIEWS: (state, view) => {
|
98
|
DEL_LEFT_VIEWS: (state, view) => {
|
|
96
|
const index = state.visitedViews.findIndex(v => v.path === view.path)
|
99
|
const index = state.visitedViews.findIndex(v => v.path === view.path)
|
|
@@ -105,10 +108,12 @@ const mutations = { |
|
@@ -105,10 +108,12 @@ const mutations = { |
|
105
|
if (i > -1) {
|
108
|
if (i > -1) {
|
|
106
|
state.cachedViews.splice(i, 1)
|
109
|
state.cachedViews.splice(i, 1)
|
|
107
|
}
|
110
|
}
|
|
|
|
111
|
+ if(item.meta.link) {
|
|
|
|
112
|
+ const fi = state.iframeViews.findIndex(v => v.path === item.path)
|
|
|
|
113
|
+ state.iframeViews.splice(fi, 1)
|
|
|
|
114
|
+ }
|
|
108
|
return false
|
115
|
return false
|
|
109
|
})
|
116
|
})
|
|
110
|
- const iframeIndex = state.iframeViews.findIndex(v => v.path === view.path)
|
|
|
|
111
|
- state.iframeViews = state.iframeViews.filter((item, idx) => idx >= iframeIndex)
|
|
|
|
112
|
}
|
117
|
}
|
|
113
|
}
|
118
|
}
|
|
114
|
|
119
|
|