|
@@ -9,16 +9,16 @@ |
|
@@ -9,16 +9,16 @@ |
|
9
|
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
9
|
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
|
10
|
tag="span"
|
10
|
tag="span"
|
|
11
|
class="tags-view-item"
|
11
|
class="tags-view-item"
|
|
12
|
- @click.middle.native="closeSelectedTag(tag)"
|
12
|
+ @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
|
|
13
|
@contextmenu.prevent.native="openMenu(tag,$event)"
|
13
|
@contextmenu.prevent.native="openMenu(tag,$event)"
|
|
14
|
>
|
14
|
>
|
|
15
|
{{ tag.title }}
|
15
|
{{ tag.title }}
|
|
16
|
- <span v-if="!tag.meta.affix" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
16
|
+ <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
|
17
|
</router-link>
|
17
|
</router-link>
|
|
18
|
</scroll-pane>
|
18
|
</scroll-pane>
|
|
19
|
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
19
|
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
|
20
|
<li @click="refreshSelectedTag(selectedTag)">刷新页面</li>
|
20
|
<li @click="refreshSelectedTag(selectedTag)">刷新页面</li>
|
|
21
|
- <li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">关闭当前</li>
|
21
|
+ <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭当前</li>
|
|
22
|
<li @click="closeOthersTags">关闭其他</li>
|
22
|
<li @click="closeOthersTags">关闭其他</li>
|
|
23
|
<li @click="closeAllTags(selectedTag)">关闭所有</li>
|
23
|
<li @click="closeAllTags(selectedTag)">关闭所有</li>
|
|
24
|
</ul>
|
24
|
</ul>
|
|
@@ -69,6 +69,9 @@ export default { |
|
@@ -69,6 +69,9 @@ export default { |
|
69
|
isActive(route) {
|
69
|
isActive(route) {
|
|
70
|
return route.path === this.$route.path
|
70
|
return route.path === this.$route.path
|
|
71
|
},
|
71
|
},
|
|
|
|
72
|
+ isAffix(tag) {
|
|
|
|
73
|
+ return tag.meta && tag.meta.affix
|
|
|
|
74
|
+ },
|
|
72
|
filterAffixTags(routes, basePath = '/') {
|
75
|
filterAffixTags(routes, basePath = '/') {
|
|
73
|
let tags = []
|
76
|
let tags = []
|
|
74
|
routes.forEach(route => {
|
77
|
routes.forEach(route => {
|