From 1df12e5ea07f7574e2a446896f5910190e797996 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Wed, 17 Apr 2024 14:43:32 +0800 Subject: [PATCH] =?UTF-8?q?wip:=20=E7=BB=A7=E7=BB=AD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/config/tags.ts | 4 +-- src/composables/page.ts | 7 ++++- src/composables/web/full-content.ts | 2 +- .../nlayout/components/breadcrumb/index.vue | 2 +- src/layouts/nlayout/components/menu/index.vue | 29 ++++--------------- .../nlayout/components/menu/mix-menu.vue | 2 +- .../nlayout/components/menu/mix-sub-menu.vue | 17 ++++------- .../tabs/components/tab-dropdown.vue | 2 +- .../components/tabs/components/tab-quick.vue | 2 +- .../components/tabs/components/types.ts | 2 +- src/layouts/nlayout/components/tabs/index.vue | 2 +- src/modules/router/router.ts | 2 +- src/modules/router/routes/basic.ts | 2 +- src/pages/index.vue | 15 +++++----- src/stores/multiple-tab.ts | 14 ++++----- src/typed-router.d.ts | 1 + src/types/tabs.d.ts | 2 +- src/utils/router/helper.ts | 2 +- src/utils/router/menus/index.ts | 2 +- src/utils/router/mitt/index.ts | 2 +- vite.config.ts | 28 ++++++++++++++++++ 21 files changed, 76 insertions(+), 65 deletions(-) diff --git a/src/composables/config/tags.ts b/src/composables/config/tags.ts index eaad2b5..b3b95af 100644 --- a/src/composables/config/tags.ts +++ b/src/composables/config/tags.ts @@ -1,4 +1,4 @@ -import type { RouteLocationNormalized, Router } from 'vue-router' +import type { RouteLocationNormalized, Router } from 'vue-router/auto' import { TabActionEnum } from '~/constants' export function useTabs(_router?: Router) { @@ -8,7 +8,7 @@ export function useTabs(_router?: Router) { const { show } = unref(appStore.tabTar) if (!show) { throw new Error( - 'The multi-tab page is currently not open, please open it in the settings!', + 'The multi-tab page is currently not open, please open it in the settings!', ) } return !!show diff --git a/src/composables/page.ts b/src/composables/page.ts index 833469e..6a9cc6c 100644 --- a/src/composables/page.ts +++ b/src/composables/page.ts @@ -1,4 +1,4 @@ -import type { RouteLocationRaw, Router } from 'vue-router' +import type { RouteLocationRaw, Router } from 'vue-router/auto' import { PageEnum, REDIRECT_NAME } from '~/constants' export type PathAsPageEnum = T extends { path: string } ? T & { path: PageEnum } : T @@ -29,13 +29,18 @@ export function useRedo(_router?: Router) { return } if (name && Object.keys(params).length > 0) { + // @ts-expect-error tstype params._redirect_type = 'name' + // @ts-expect-error tstype params.path = String(name) } else { + // @ts-expect-error tstype params._redirect_type = 'path' + // @ts-expect-error tstype params.path = fullPath } + // @ts-expect-error tstype push({ name: REDIRECT_NAME, params, query }).then(() => resolve(true)) }) } diff --git a/src/composables/web/full-content.ts b/src/composables/web/full-content.ts index 3f6a596..963be59 100644 --- a/src/composables/web/full-content.ts +++ b/src/composables/web/full-content.ts @@ -1,4 +1,4 @@ -import { useRouter } from 'vue-router' +import { useRouter } from 'vue-router/auto' export function useFullContent() { const configStore = useAppConfigStore() diff --git a/src/layouts/nlayout/components/breadcrumb/index.vue b/src/layouts/nlayout/components/breadcrumb/index.vue index 2501bc7..7ebe0ae 100644 --- a/src/layouts/nlayout/components/breadcrumb/index.vue +++ b/src/layouts/nlayout/components/breadcrumb/index.vue @@ -1,5 +1,5 @@