| | |
| | | v-for="tag in visitedViews"
|
| | | ref="tag"
|
| | | :key="tag.path"
|
| | | :class="isActive(tag)?'active':''"
|
| | | :class="{ 'active': isActive(tag), 'has-icon': tagsIcon }"
|
| | | :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
| | | tag="span"
|
| | | class="tags-view-item"
|
| | |
| | | @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
|
| | | @contextmenu.prevent.native="openMenu(tag,$event)"
|
| | | >
|
| | | <svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" />
|
| | | {{ tag.title }}
|
| | | <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
| | | </router-link>
|
| | |
| | | return this.$store.state.permission.routes
|
| | | },
|
| | | theme() {
|
| | | return this.$store.state.settings.theme;
|
| | | return this.$store.state.settings.theme
|
| | | },
|
| | | tagsIcon() {
|
| | | return this.$store.state.settings.tagsIcon
|
| | | }
|
| | | },
|
| | | watch: {
|
| | |
| | | return route.path === this.$route.path
|
| | | },
|
| | | activeStyle(tag) {
|
| | | if (!this.isActive(tag)) return {};
|
| | | if (!this.isActive(tag)) return {}
|
| | | return {
|
| | | "background-color": this.theme,
|
| | | "border-color": this.theme
|
| | | };
|
| | | }
|
| | | },
|
| | | isAffix(tag) {
|
| | | return tag.meta && tag.meta.affix
|
| | |
| | | const { name } = this.$route
|
| | | if (name) {
|
| | | this.$store.dispatch('tagsView/addView', this.$route)
|
| | | if (this.$route.meta.link) {
|
| | | this.$store.dispatch('tagsView/addIframeView', this.$route)
|
| | | }
|
| | | }
|
| | | return false
|
| | | },
|
| | | moveToCurrentTag() {
|
| | | const tags = this.$refs.tag
|
| | |
| | | })
|
| | | },
|
| | | refreshSelectedTag(view) {
|
| | | this.$tab.refreshPage(view);
|
| | | this.$tab.refreshPage(view)
|
| | | if (this.$route.meta.link) {
|
| | | this.$store.dispatch('tagsView/delIframeView', this.$route)
|
| | | }
|
| | |
| | | })
|
| | | },
|
| | | closeOthersTags() {
|
| | | this.$router.push(this.selectedTag).catch(()=>{});
|
| | | this.$router.push(this.selectedTag.fullPath).catch(()=>{})
|
| | | this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
| | | this.moveToCurrentTag()
|
| | | })
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .tags-view-item.active.has-icon::before {
|
| | | content: none !important;
|
| | | }
|
| | |
|
| | | .contextmenu {
|
| | | margin: 0;
|
| | | background: #fff;
|