perf[tagsView]: pref DEL_CACHED_VIEW and DEL_OTHERS_CACHED_VIEWS function (#2626)
This commit is contained in:
parent
9c723c6618
commit
0343988f3d
|
@ -28,13 +28,8 @@ const mutations = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
DEL_CACHED_VIEW: (state, view) => {
|
DEL_CACHED_VIEW: (state, view) => {
|
||||||
for (const i of state.cachedViews) {
|
const index = state.cachedViews.indexOf(view.name)
|
||||||
if (i === view.name) {
|
index > -1 && state.cachedViews.splice(index, 1)
|
||||||
const index = state.cachedViews.indexOf(i)
|
|
||||||
state.cachedViews.splice(index, 1)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
|
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
|
||||||
|
@ -43,13 +38,8 @@ const mutations = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
||||||
for (const i of state.cachedViews) {
|
const index = state.cachedViews.indexOf(view.name)
|
||||||
if (i === view.name) {
|
index > -1 && (state.cachedViews = state.cachedViews.slice(index, index + 1))
|
||||||
const index = state.cachedViews.indexOf(i)
|
|
||||||
state.cachedViews = state.cachedViews.slice(index, index + 1)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_ALL_VISITED_VIEWS: state => {
|
DEL_ALL_VISITED_VIEWS: state => {
|
||||||
|
|
Loading…
Reference in New Issue