From ff9fdff18b1fde945104272dc7df42deebe538f0 Mon Sep 17 00:00:00 2001 From: K <1175047471@qq.com> Date: Fri, 12 Jan 2024 17:08:34 +0800 Subject: [PATCH] chore: remove declare module '*.vue' --- src/router/helper/routeHelper.ts | 3 ++- src/router/types.ts | 4 ++-- src/types/module.d.ts | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/router/helper/routeHelper.ts b/src/router/helper/routeHelper.ts index f5bef83..9276c78 100644 --- a/src/router/helper/routeHelper.ts +++ b/src/router/helper/routeHelper.ts @@ -1,6 +1,7 @@ import type { RouteRecordNormalized, Router } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router' import { cloneDeep, omit } from 'lodash-es' +import type { Component } from 'vue' import { EXCEPTION_COMPONENT, LAYOUT, getParentLayout } from '@/router/constant' import type { AppRouteModule, AppRouteRecordRaw } from '@/router/types' import { warn } from '@/utils/log' @@ -8,7 +9,7 @@ import { isHttpUrl } from '@/utils/is' export type LayoutMapKey = 'LAYOUT' const IFRAME = () => import('@/views/base/iframe/FrameBlank.vue') -const LayoutMap = new Map Promise>() +const LayoutMap = new Map Promise>() LayoutMap.set('LAYOUT', LAYOUT) LayoutMap.set('IFRAME', IFRAME) diff --git a/src/router/types.ts b/src/router/types.ts index b1fea8e..8116417 100644 --- a/src/router/types.ts +++ b/src/router/types.ts @@ -1,8 +1,8 @@ import type { RouteMeta, RouteRecordRaw } from 'vue-router' -import type { defineComponent } from 'vue' +import type { Component as VueComponent, defineComponent } from 'vue' import type { RoleEnum } from '@/enums/roleEnum' -export type Component = ReturnType | (() => Promise) | (() => Promise) +export type Component = ReturnType | (() => Promise) | (() => Promise) export interface AppRouteRecordRaw extends Omit { keepAlive?: boolean diff --git a/src/types/module.d.ts b/src/types/module.d.ts index d464833..4f96b7f 100644 --- a/src/types/module.d.ts +++ b/src/types/module.d.ts @@ -1,9 +1,9 @@ -declare module '*.vue' { - import type { DefineComponent } from 'vue' +// declare module '*.vue' { +// import type { DefineComponent } from 'vue' - const Component: DefineComponent - export default Component -} +// const Component: DefineComponent +// export default Component +// } declare module 'ant-design-vue/es/locale/*' { import type { Locale } from 'ant-design-vue/types/locale-provider'