From bf4a8543ca9f4e9ef6d13f78385f5c0f30255dc0 Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期六, 06 五月 2023 09:25:05 +0800 Subject: [PATCH] Merge branch 'ts' into dev --- src/components/TopNav/index.vue | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index 79b7786..2092415 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -104,7 +104,7 @@ visibleNumber.value = parseInt(String(width / 85)); } -const handleSelect = (key: string, keyPath: string[]) => { +const handleSelect = (key: string) => { currentIndex.value = key; const route = routers.value.find(item => item.path === key); if (isHttp(key)) { @@ -112,7 +112,13 @@ window.open(key, "_blank"); } else if (!route || !route.children) { // 娌℃湁瀛愯矾鐢辫矾寰勫唴閮ㄦ墦寮� - router.push({ path: key, fullPath: '' }); + const routeMenu = childrenMenus.value.find(item => item.path === key); + if (routeMenu && routeMenu.query) { + let query = JSON.parse(routeMenu.query); + router.push({ path: key, query: query }); + } else { + router.push({ path: key }); + } appStore.toggleSideBarHide(true); } else { // 鏄剧ず宸︿晶鑱斿姩鑿滃崟 -- Gitblit v1.9.3