pull/8726/merge
dreamcc 2025-09-08 12:17:00 +08:00 committed by GitHub
commit fee5ad44c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 3 deletions

View File

@ -251,8 +251,13 @@
} }
} }
function handleMenuClick(path: string) { function handleMenuClick(path: string, item?: any) {
go(path); // query
if (item?.meta?.queryParams) {
go({ path, query: item.meta.queryParams } as any);
} else {
go(path);
}
} }
function handleClickOutside() { function handleClickOutside() {
@ -266,7 +271,14 @@
onMouseenter: () => handleModuleClick(item.path, true), onMouseenter: () => handleModuleClick(item.path, true),
onClick: async () => { onClick: async () => {
const children = await getChildrenMenus(item.path); const children = await getChildrenMenus(item.path);
if (item.path && (!children || children.length === 0)) go(item.path); if (item.path && (!children || children.length === 0)) {
// query
if (item?.meta?.queryParams) {
go({ path: item.path, query: item.meta.queryParams } as any);
} else {
go(item.path);
}
}
}, },
}; };
} }