Skip to content

Commit 2a590a2

Browse files
tmpbookPanJiaChen
authored andcommitted
Support route query in TagView (PanJiaChen#765)
1 parent c93fcef commit 2a590a2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/store/modules/tagsView.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ const tagsView = {
66
mutations: {
77
ADD_VISITED_VIEWS: (state, view) => {
88
if (state.visitedViews.some(v => v.path === view.path)) return
9-
state.visitedViews.push({
10-
name: view.name,
11-
path: view.path,
9+
state.visitedViews.push(Object.assign({}, view, {
1210
title: view.meta.title || 'no-name'
13-
})
11+
}))
1412
if (!view.meta.noCache) {
1513
state.cachedViews.push(view.name)
1614
}

src/views/layout/components/TagsView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="tags-view-container">
33
<scroll-pane class='tags-view-wrapper' ref='scrollPane'>
44
<router-link ref='tag' class="tags-view-item" :class="isActive(tag)?'active':''" v-for="tag in Array.from(visitedViews)"
5-
:to="tag.path" :key="tag.path" @contextmenu.prevent.native="openMenu(tag,$event)">
5+
:to="tag" :key="tag.path" @contextmenu.prevent.native="openMenu(tag,$event)">
66
{{generateTitle(tag.title)}}
77
<span class='el-icon-close' @click.prevent.stop='closeSelectedTag(tag)'></span>
88
</router-link>

0 commit comments

Comments
 (0)