| | |
| | | <router-link v-for="tag in visitedViews" :key="tag.path" |
| | | :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" custom |
| | | v-slot="{ navigate, isActive, isExactActive }" ref="tag"> |
| | | <span :class="['tags-view-item', isActive && 'router-link-active', isExactActive && 'router-link-exact-active']" |
| | | <span :class="['tags-view-item', isActive && 'router-link-active', isExactActive && 'router-link-exact-active', tag.meta.icon && 'hide-dot']" |
| | | @click="navigate" |
| | | @click.middle="!isAffix(tag) ? closeSelectedTag(tag) : ''" |
| | | @contextmenu.prevent="openMenu(tag, $event)"> |
| | | <svg-icon v-if="tag.meta.icon" :icon-class="tag.meta.icon" /> |
| | | {{ tag.title }} |
| | | <icon-close v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" /> |
| | | </span> |
| | |
| | | import path from 'path-browserify'; |
| | | import store from '@/store'; |
| | | import { Close as IconClose } from '@element-plus/icons-vue'; |
| | | import SvgIcon from '@/components/SvgIcon/index.vue'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'TagsView', |
| | | components: { ScrollPane, IconClose }, |
| | | components: { SvgIcon, ScrollPane, IconClose }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | |
| | | position: relative; |
| | | margin-right: 2px; |
| | | } |
| | | &.hide-dot { |
| | | &::before { |
| | | width: 0; |
| | | height: 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |