From f5608a75111fa11c4e3811503024569da4457942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Fri, 11 Oct 2019 13:37:01 +0800 Subject: [PATCH] fix[TagsView]: fixed click.middle can close affixed tag bug (#2649) --- src/layout/components/TagsView/index.vue | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 1b112317..3c20275b 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -9,27 +9,18 @@ :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" tag="span" class="tags-view-item" - @click.middle.native="closeSelectedTag(tag)" + @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" @contextmenu.prevent.native="openMenu(tag,$event)" > {{ generateTitle(tag.title) }} - +
    -
  • - {{ $t('tagsView.refresh') }} -
  • -
  • - {{ - $t('tagsView.close') }} -
  • -
  • - {{ $t('tagsView.closeOthers') }} -
  • -
  • - {{ $t('tagsView.closeAll') }} -
  • +
  • {{ $t('tagsView.refresh') }}
  • +
  • {{ $t('tagsView.close') }}
  • +
  • {{ $t('tagsView.closeOthers') }}
  • +
  • {{ $t('tagsView.closeAll') }}
@@ -80,6 +71,9 @@ export default { isActive(route) { return route.path === this.$route.path }, + isAffix(tag) { + return tag.meta && tag.meta.affix + }, filterAffixTags(routes, basePath = '/') { let tags = [] routes.forEach(route => {