Browse Source

Finish Hotfix-zh-70

howie 3 years ago
parent
commit
5450d5ddcf
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/layout/components/TagsView/index.vue

+ 4 - 2
src/layout/components/TagsView/index.vue

@@ -1,12 +1,13 @@
 <template>
   <div id="tags-view-container" class="tags-view-container">
     <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
+<!--      path: tag.path-->
       <router-link
         v-for="tag in visitedViews"
         ref="tag"
         :key="tag.path"
         :class="isActive(tag)?'active':''"
-        :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
+        :to="{ name: tag.name, query: tag.query, fullPath: tag.fullPath }"
         tag="span"
         class="tags-view-item"
         @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
@@ -42,6 +43,7 @@ export default {
   },
   computed: {
     visitedViews() {
+      console.log(this.$store.state.tagsView.visitedViews)
       return this.$store.state.tagsView.visitedViews
     },
     routes() {
@@ -67,7 +69,7 @@ export default {
   },
   methods: {
     isActive(route) {
-      return route.path === this.$route.path
+      return route.name === this.$route.name
     },
     isAffix(tag) {
       return tag.meta && tag.meta.affix