fix: 修复卡片标签页模式下,通过query路由传参时,离开激活的标签后仍存在card-active属性,导致鼠标hover时字体颜色未改变

This commit is contained in:
xiaoxian521 2023-07-20 12:41:15 +08:00
parent e404770718
commit 413c375942
2 changed files with 3 additions and 9 deletions

View File

@ -522,13 +522,7 @@ onBeforeUnmount(() => {
:ref="'dynamic' + index"
v-for="(item, index) in multiTags"
:key="index"
:class="[
'scroll-item is-closable',
linkIsActive(item),
route.path === item.path && showModel === 'card'
? 'card-active'
: ''
]"
:class="['scroll-item is-closable', linkIsActive(item)]"
@contextmenu.prevent="openMenu(item, $event)"
@mouseenter.prevent="onMouseenter(index)"
@mouseleave.prevent="onMouseleave(index)"

View File

@ -175,7 +175,7 @@ export function useTags() {
toggleClass(true, "schedule-in", instance.refs["schedule" + index][0]);
toggleClass(false, "schedule-out", instance.refs["schedule" + index][0]);
} else {
if (hasClass(instance.refs["dynamic" + index][0], "card-active")) return;
if (hasClass(instance.refs["dynamic" + index][0], "is-active")) return;
toggleClass(true, "card-in", instance.refs["dynamic" + index][0]);
toggleClass(false, "card-out", instance.refs["dynamic" + index][0]);
}
@ -190,7 +190,7 @@ export function useTags() {
toggleClass(false, "schedule-in", instance.refs["schedule" + index][0]);
toggleClass(true, "schedule-out", instance.refs["schedule" + index][0]);
} else {
if (hasClass(instance.refs["dynamic" + index][0], "card-active")) return;
if (hasClass(instance.refs["dynamic" + index][0], "is-active")) return;
toggleClass(false, "card-in", instance.refs["dynamic" + index][0]);
toggleClass(true, "card-out", instance.refs["dynamic" + index][0]);
}