mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-04-06 03:57:53 +08:00
fix[tagsView]: update tagsview when query is different(#1090)
This commit is contained in:
parent
3277343804
commit
11163146c0
@ -60,6 +60,15 @@ const tagsView = {
|
|||||||
},
|
},
|
||||||
DEL_ALL_CACHED_VIEWS: state => {
|
DEL_ALL_CACHED_VIEWS: state => {
|
||||||
state.cachedViews = []
|
state.cachedViews = []
|
||||||
|
},
|
||||||
|
|
||||||
|
UPDATE_VISITED_VIEW: (state, view) => {
|
||||||
|
for (let v of state.visitedViews) {
|
||||||
|
if (v.path === view.path) {
|
||||||
|
v = Object.assign(v, view)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -142,6 +151,10 @@ const tagsView = {
|
|||||||
commit('DEL_ALL_CACHED_VIEWS')
|
commit('DEL_ALL_CACHED_VIEWS')
|
||||||
resolve([...state.cachedViews])
|
resolve([...state.cachedViews])
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
updateVisitedView({ commit }, view) {
|
||||||
|
commit('UPDATE_VISITED_VIEW', view)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,12 @@ export default {
|
|||||||
for (const tag of tags) {
|
for (const tag of tags) {
|
||||||
if (tag.to.path === this.$route.path) {
|
if (tag.to.path === this.$route.path) {
|
||||||
this.$refs.scrollPane.moveToTarget(tag.$el)
|
this.$refs.scrollPane.moveToTarget(tag.$el)
|
||||||
|
|
||||||
|
// when query is different then update
|
||||||
|
if (tag.to.fullPath !== this.$route.fullPath) {
|
||||||
|
this.$store.dispatch('updateVisitedView', this.$route)
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user