diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 9e12c66226f07e53b375680c3efc11809f436844..a89763806df2d5cb76afd06744ed4faf06d43a94 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -16,7 +16,7 @@ export default { return this.$store.state.tagsView.cachedViews }, key() { - return this.$route.fullPath + return this.$route.path } } } diff --git a/src/views/tab/index.vue b/src/views/tab/index.vue index e5746580df7f52b0f9ff5b7193f584124401ac37..6438a47a72319a102a3a94a867d4590181544035 100644 --- a/src/views/tab/index.vue +++ b/src/views/tab/index.vue @@ -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