|
|
|
@ -52,8 +52,11 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
generateTitle, // generateTitle by vue-i18n
|
|
|
|
|
generateRoute() {
|
|
|
|
|
if (this.$route.name) {
|
|
|
|
|
return this.$route
|
|
|
|
|
let matched = [...this.$route.matched]
|
|
|
|
|
matched.splice(0, 1)
|
|
|
|
|
matched = matched.filter(item => item.name)
|
|
|
|
|
if (matched) {
|
|
|
|
|
return matched
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
},
|
|
|
|
@ -61,11 +64,17 @@ export default {
|
|
|
|
|
return route.path === this.$route.path || route.name === this.$route.name
|
|
|
|
|
},
|
|
|
|
|
addViewTags() {
|
|
|
|
|
const route = this.generateRoute()
|
|
|
|
|
if (!route) {
|
|
|
|
|
const routes = this.generateRoute()
|
|
|
|
|
if (!routes) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
this.$store.dispatch('addVisitedViews', route)
|
|
|
|
|
const length = routes.length
|
|
|
|
|
routes.forEach((item, index) => {
|
|
|
|
|
if (index === length - 1) {
|
|
|
|
|
item.showInVisitedViews = true
|
|
|
|
|
}
|
|
|
|
|
this.$store.dispatch('addVisitedViews', item)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
moveToCurrentTag() {
|
|
|
|
|
const tags = this.$refs.tag
|
|
|
|
|