From 7757d96f3444c283a21021324a7abcb22a29ee2e Mon Sep 17 00:00:00 2001 From: running0503 <xiangdeshan_120@sina.com> Date: 星期三, 31 五月 2023 15:27:16 +0800 Subject: [PATCH] update vite/plugins/unocss.ts. 因低浏览器不支持 top-level await,会报 __uno.css:9 Uncaught SyntaxError: Unexpected reserved word --- 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