fix[tagsView]: fixed DEL_OTHERS_CACHED_VIEWS bug
This commit is contained in:
parent
0343988f3d
commit
f266713daf
|
@ -39,7 +39,12 @@ const mutations = {
|
||||||
},
|
},
|
||||||
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
||||||
const index = state.cachedViews.indexOf(view.name)
|
const index = state.cachedViews.indexOf(view.name)
|
||||||
index > -1 && (state.cachedViews = state.cachedViews.slice(index, index + 1))
|
if (index > -1) {
|
||||||
|
state.cachedViews = state.cachedViews.slice(index, index + 1)
|
||||||
|
} else {
|
||||||
|
// if index = -1, there is no cached tags
|
||||||
|
state.cachedViews = []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_ALL_VISITED_VIEWS: state => {
|
DEL_ALL_VISITED_VIEWS: state => {
|
||||||
|
|
Loading…
Reference in New Issue