refactor[store]: refactor tagsView store (#1032)

This commit is contained in:
花裤衩
2018-08-31 16:00:28 +08:00
committed by GitHub
parent 0fe3f181ad
commit d0d1addba8
3 changed files with 88 additions and 26 deletions

View File

@@ -72,7 +72,7 @@ export default {
if (!route) {
return false
}
this.$store.dispatch('addVisitedViews', route)
this.$store.dispatch('addView', route)
},
moveToCurrentTag() {
const tags = this.$refs.tag
@@ -86,9 +86,9 @@ export default {
})
},
closeSelectedTag(view) {
this.$store.dispatch('delVisitedViews', view).then((views) => {
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
if (this.isActive(view)) {
const latestView = views.slice(-1)[0]
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
this.$router.push(latestView)
} else {