|
@@ -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
|