Skip to content

Commit ab47133

Browse files
PanJiaChenTrong. Pham Van - CMC Global DU1.19
authored and
Trong. Pham Van - CMC Global DU1.19
committedJul 22, 2022
fix[TagsView]: fixed click.middle can close affixed tag bug (PanJiaChen#2649)
1 parent 3883819 commit ab47133

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎src/layout/components/TagsView/index.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
1010
tag="span"
1111
class="tags-view-item"
12-
@click.middle.native="closeSelectedTag(tag)"
12+
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
1313
@contextmenu.prevent.native="openMenu(tag,$event)"
1414
>
1515
{{ 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)" />
1717
</router-link>
1818
</scroll-pane>
1919
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
2020
<li @click="refreshSelectedTag(selectedTag)">Refresh</li>
21-
<li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">Close</li>
21+
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">Close</li>
2222
<li @click="closeOthersTags">Close Others</li>
2323
<li @click="closeAllTags(selectedTag)">Close All</li>
2424
</ul>
@@ -69,6 +69,9 @@ export default {
6969
isActive(route) {
7070
return route.path === this.$route.path
7171
},
72+
isAffix(tag) {
73+
return tag.meta && tag.meta.affix
74+
},
7275
filterAffixTags(routes, basePath = '/') {
7376
let tags = []
7477
routes.forEach(route => {

0 commit comments

Comments
 (0)