forked from AkkomaGang/admin-fe
refine tab-views
This commit is contained in:
parent
e3198fd47d
commit
6cb64bebdc
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
|||
import Cookies from 'js-cookie';
|
||||
|
||||
|
||||
const app = {
|
||||
state: {
|
||||
sidebar: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class='tabs-view-container'>
|
||||
<router-link class="tabs-view" v-for="tag in Array.from(visitedViews)" :to="tag.path" :key="tag.path">
|
||||
<el-tag :closable="true" @close='closeViewTabs(tag,$event)'>
|
||||
<el-tag :closable="true" :type="isActive(tag.path)?'primary':''" @close='closeViewTabs(tag,$event)'>
|
||||
{{tag.name}}
|
||||
</el-tag>
|
||||
</router-link>
|
||||
|
@ -29,6 +29,9 @@
|
|||
},
|
||||
addViewTabs() {
|
||||
this.$store.dispatch('addVisitedViews', this.generateRoute())
|
||||
},
|
||||
isActive(path) {
|
||||
return path === this.$route.path
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
Loading…
Reference in a new issue