feat: add tab url demo (#2114)
This commit is contained in:
parent
f891202706
commit
e8837d161e
|
@ -16,7 +16,7 @@ export default {
|
|||
return this.$store.state.tagsView.cachedViews
|
||||
},
|
||||
key() {
|
||||
return this.$route.fullPath
|
||||
return this.$route.path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,18 @@ export default {
|
|||
createdTimes: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
activeName(val) {
|
||||
this.$router.push(`${this.$route.path}?tab=${val}`)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// init the default selected tab
|
||||
const tab = this.$route.query.tab
|
||||
if (tab) {
|
||||
this.activeName = tab
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showCreatedTimes() {
|
||||
this.createdTimes = this.createdTimes + 1
|
||||
|
|
Loading…
Reference in New Issue