THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

perf[tagsView]: pref DEL_CACHED_VIEW and DEL_OTHERS_CACHED_VIEWS function (#2626)

pull/2632/head
monkeycf 花裤衩 4 months ago
parent
commit
0343988f3d
1 changed files with 4 additions and 14 deletions
  1. +4
    -14
      src/store/modules/tagsView.js

+ 4
- 14
src/store/modules/tagsView.js View File

@@ -28,13 +28,8 @@ const mutations = {
}
},
DEL_CACHED_VIEW: (state, view) => {
for (const i of state.cachedViews) {
if (i === view.name) {
const index = state.cachedViews.indexOf(i)
state.cachedViews.splice(index, 1)
break
}
}
const index = state.cachedViews.indexOf(view.name)
index > -1 && state.cachedViews.splice(index, 1)
},

DEL_OTHERS_VISITED_VIEWS: (state, view) => {
@@ -43,13 +38,8 @@ const mutations = {
})
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
for (const i of state.cachedViews) {
if (i === view.name) {
const index = state.cachedViews.indexOf(i)
state.cachedViews = state.cachedViews.slice(index, index + 1)
break
}
}
const index = state.cachedViews.indexOf(view.name)
index > -1 && (state.cachedViews = state.cachedViews.slice(index, index + 1))
},

DEL_ALL_VISITED_VIEWS: state => {


Loading…
Cancel
Save