Support route query in TagView (#765)
This commit is contained in:
parent
c93fcefe54
commit
2a590a2087
|
@ -6,11 +6,9 @@ const tagsView = {
|
||||||
mutations: {
|
mutations: {
|
||||||
ADD_VISITED_VIEWS: (state, view) => {
|
ADD_VISITED_VIEWS: (state, view) => {
|
||||||
if (state.visitedViews.some(v => v.path === view.path)) return
|
if (state.visitedViews.some(v => v.path === view.path)) return
|
||||||
state.visitedViews.push({
|
state.visitedViews.push(Object.assign({}, view, {
|
||||||
name: view.name,
|
|
||||||
path: view.path,
|
|
||||||
title: view.meta.title || 'no-name'
|
title: view.meta.title || 'no-name'
|
||||||
})
|
}))
|
||||||
if (!view.meta.noCache) {
|
if (!view.meta.noCache) {
|
||||||
state.cachedViews.push(view.name)
|
state.cachedViews.push(view.name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="tags-view-container">
|
<div class="tags-view-container">
|
||||||
<scroll-pane class='tags-view-wrapper' ref='scrollPane'>
|
<scroll-pane class='tags-view-wrapper' ref='scrollPane'>
|
||||||
<router-link ref='tag' class="tags-view-item" :class="isActive(tag)?'active':''" v-for="tag in Array.from(visitedViews)"
|
<router-link ref='tag' class="tags-view-item" :class="isActive(tag)?'active':''" v-for="tag in Array.from(visitedViews)"
|
||||||
:to="tag.path" :key="tag.path" @contextmenu.prevent.native="openMenu(tag,$event)">
|
:to="tag" :key="tag.path" @contextmenu.prevent.native="openMenu(tag,$event)">
|
||||||
{{generateTitle(tag.title)}}
|
{{generateTitle(tag.title)}}
|
||||||
<span class='el-icon-close' @click.prevent.stop='closeSelectedTag(tag)'></span>
|
<span class='el-icon-close' @click.prevent.stop='closeSelectedTag(tag)'></span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
Loading…
Reference in New Issue