fix[tagsView]: refresh bug (#1059)

#1051
This commit is contained in:
jiuwuxiaohun 2018-09-11 13:39:18 +08:00 committed by 花裤衩
parent 9c03dd3514
commit 0740bb36f7
2 changed files with 9 additions and 6 deletions

View File

@ -32,10 +32,12 @@ export default {
// In order to make the cached page re-rendered // In order to make the cached page re-rendered
this.$store.dispatch('delAllCachedViews', this.$route) this.$store.dispatch('delAllCachedViews', this.$route)
const { path } = this.$route const { fullPath } = this.$route
this.$nextTick(() => {
this.$router.replace({ this.$router.replace({
path: '/redirect' + path path: '/redirect' + fullPath
})
}) })
} }
} }

View File

@ -89,11 +89,12 @@ export default {
refreshSelectedTag(view) { refreshSelectedTag(view) {
this.$store.dispatch('delCachedView', view).then(() => { this.$store.dispatch('delCachedView', view).then(() => {
const { fullPath } = view const { fullPath } = view
this.$nextTick(() => {
this.$router.replace({ this.$router.replace({
path: '/redirect' + fullPath path: '/redirect' + fullPath
}) })
}) })
})
}, },
closeSelectedTag(view) { closeSelectedTag(view) {
this.$store.dispatch('delView', view).then(({ visitedViews }) => { this.$store.dispatch('delView', view).then(({ visitedViews }) => {