Skip to content

Commit 6cb64be

Browse files
committed
refine tab-views
1 parent e3198fd commit 6cb64be

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/store/modules/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Cookies from 'js-cookie';
22

3-
43
const app = {
54
state: {
65
sidebar: {

src/views/layout/TabsView.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class='tabs-view-container'>
33
<router-link class="tabs-view" v-for="tag in Array.from(visitedViews)" :to="tag.path" :key="tag.path">
4-
<el-tag :closable="true" @close='closeViewTabs(tag,$event)'>
4+
<el-tag :closable="true" :type="isActive(tag.path)?'primary':''" @close='closeViewTabs(tag,$event)'>
55
{{tag.name}}
66
</el-tag>
77
</router-link>
@@ -29,6 +29,9 @@
2929
},
3030
addViewTabs() {
3131
this.$store.dispatch('addVisitedViews', this.generateRoute())
32+
},
33+
isActive(path) {
34+
return path === this.$route.path
3235
}
3336
},
3437
watch: {

0 commit comments

Comments
 (0)