fix[tagsView]: fixed moveToCurrentTag bug

This commit is contained in:
Pan 2018-10-17 14:08:00 +08:00
parent 96bda5515c
commit f94aa1aca3
1 changed files with 3 additions and 3 deletions

View File

@ -5,14 +5,14 @@
v-for="tag in visitedViews" v-for="tag in visitedViews"
ref="tag" ref="tag"
:class="isActive(tag)?'active':''" :class="isActive(tag)?'active':''"
:to="tag.fullPath" :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
:key="tag.path" :key="tag.path"
tag="span" tag="span"
class="tags-view-item" class="tags-view-item"
@click.middle.native="closeSelectedTag(tag)" @click.middle.native="closeSelectedTag(tag)"
@contextmenu.prevent.native="openMenu(tag,$event)"> @contextmenu.prevent.native="openMenu(tag,$event)">
{{ generateTitle(tag.title) }} {{ generateTitle(tag.title) }}
<span class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/> <span class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
</router-link> </router-link>
</scroll-pane> </scroll-pane>
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
@ -75,7 +75,7 @@ export default {
const tags = this.$refs.tag const tags = this.$refs.tag
this.$nextTick(() => { this.$nextTick(() => {
for (const tag of tags) { for (const tag of tags) {
if (tag.to === this.$route.fullPath) { if (tag.to.path === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag) this.$refs.scrollPane.moveToTarget(tag)
// when query is different then update // when query is different then update