Skip to content

Commit

Permalink
fix issues #65
Browse files Browse the repository at this point in the history
  • Loading branch information
bumandpunk committed Sep 5, 2022
1 parent 0262632 commit 5a94e7a
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/layout/components/TagsView/TagsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ watch(
() => $route.path,
() => {
addTags()
moveToCurrentTag()
// tag remove has issue
// moveToCurrentTag()
}
)
watch(
Expand All @@ -71,18 +71,6 @@ watch(
}
}
)
watch(
() => state.visible,
(value) => {
if (value) {
document.body.addEventListener('click', closeMenu)
} else {
document.body.removeEventListener('click', closeMenu)
}
}
)
onMounted(() => {
initTags()
addTags()
Expand All @@ -94,7 +82,18 @@ const isActive = (route) => {
const isAffix = (tag) => {
return tag.meta && tag.meta.affix
}
const refTag = ref(null)
const moveToCurrentTag= ()=> {
for (const tag of refTag.value) {
if (tag.to.path === $route.path) {
// when query is different then update
if (tag.to.fullPath !== $route.fullPath) {
tagsViewStore.updateVisitedView($route)
}
break
}
}
}
const filterAffixTags = (routes, basePath = '/') => {
let tags = []
routes.forEach((route) => {
Expand Down

0 comments on commit 5a94e7a

Please sign in to comment.