mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 00:47:19 +08:00
fix: 修复页面tag激活状态逻辑判断问题
- 当`showLink`为`false`,传递参数默认为空,当前页面路径为`/path1/index`,其余路径(`showLink:false`)为:`/path2/index`,`/path3/index`等都会显示激活状态
This commit is contained in:
parent
8816e61e3a
commit
73f4febdc1
@ -114,15 +114,12 @@ export function useTags() {
|
||||
]);
|
||||
|
||||
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(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user