mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-12-09 14:40:27 +08:00
fix: 修复页面tag激活状态逻辑判断问题
- 当`showLink`为`false`,传递参数默认为空,当前页面路径为`/path1/index`,其余路径(`showLink:false`)为:`/path2/index`,`/path3/index`等都会显示激活状态
This commit is contained in:
@@ -114,15 +114,12 @@ export function useTags() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
function conditionHandle(item, previous, next) {
|
function conditionHandle(item, previous, next) {
|
||||||
if (isBoolean(route?.meta?.showLink) && route?.meta?.showLink === false) {
|
const isSamePath = route.path === item.path;
|
||||||
if (Object.keys(route.query).length > 0) {
|
const hasQuery = Object.keys(route.query).length > 0;
|
||||||
return isEqual(route.query, item.query) ? previous : next;
|
const isSameData = hasQuery
|
||||||
} else {
|
? isEqual(route.query, item.query)
|
||||||
return isEqual(route.params, item.params) ? previous : next;
|
: isEqual(route.params, item.params);
|
||||||
}
|
return isSamePath ? (isSameData ? previous : next) : next;
|
||||||
} else {
|
|
||||||
return route.path === item.path ? previous : next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const iconIsActive = computed(() => {
|
const iconIsActive = computed(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user