Skip to content
Snippets Groups Projects
Commit 6cb64beb authored by Pan's avatar Pan Committed by 花裤衩
Browse files

refine tab-views

parent e3198fd4
No related branches found
No related tags found
No related merge requests found
import Cookies from 'js-cookie';
const app = {
state: {
sidebar: {
......
<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: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment