Skip to content

Commit

Permalink
refine tab-views
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed Jul 14, 2017
1 parent e3198fd commit 6cb64be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/store/modules/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Cookies from 'js-cookie';


const app = {
state: {
sidebar: {
Expand Down
5 changes: 4 additions & 1 deletion src/views/layout/TabsView.vue
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -29,6 +29,9 @@
},
addViewTabs() {
this.$store.dispatch('addVisitedViews', this.generateRoute())
},
isActive(path) {
return path === this.$route.path
}
},
watch: {
Expand Down

0 comments on commit 6cb64be

Please sign in to comment.