Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复页面tag激活状态逻辑判断问题 #1165

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/layout/hooks/useTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import {
isEqual,
isBoolean,

Check failure on line 18 in src/layout/hooks/useTag.ts

View workflow job for this annotation

GitHub Actions / Lint Code

'isBoolean' is defined but never used. Allowed unused vars must match /^_/u
storageLocal,
toggleClass,
hasClass
Expand Down Expand Up @@ -114,15 +114,12 @@
]);

function conditionHandle(item, previous, next) {
if (isBoolean(route?.meta?.showLink) && route?.meta?.showLink === false) {
if (Object.keys(route.query).length > 0) {
return isEqual(route.query, item.query) ? previous : next;
} else {
return isEqual(route.params, item.params) ? previous : next;
}
} else {
return route.path === item.path ? previous : next;
}
const isSamePath = route.path === item.path;
const hasQuery = Object.keys(route.query).length > 0;
const isSameData = hasQuery
? isEqual(route.query, item.query)
: isEqual(route.params, item.params);
return isSamePath ? (isSameData ? previous : next) : next;
}

const iconIsActive = computed(() => {
Expand Down
Loading