Commit ac11d887 authored by dcy's avatar dcy

关闭左侧Tab报错页面报错 bug修复

parent 782511e8
......@@ -82,6 +82,26 @@ const mutations = {
}
return false
})
},
DEL_LEFT_VIEWS: (state, view) => {
const index = state.visitedViews.findIndex(v => v.path === view.path)
if (index === -1) {
return
}
state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx >= index || (item.meta && item.meta.affix)) {
return true
}
const i = state.cachedViews.indexOf(item.name)
if (i > -1) {
state.cachedViews.splice(i, 1)
}
if(item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path)
state.iframeViews.splice(fi, 1)
}
return false
})
}
}
......@@ -176,6 +196,12 @@ const actions = {
resolve([...state.visitedViews])
})
},
delLeftTags({ commit }, view){
return new Promise(resolve => {
commit('DEL_LEFT_VIEWS', view)
resolve([...state.visitedViews])
})
},
delCurrentView({ dispatch }){
const view = router.history.current
return dispatch('delView', view).then(({visitedViews}) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment