From 4aeee485826303b406e6a48a05944166c0b5492b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 17 Mar 2023 22:58:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20useCrudSchemas=E3=80=81use?= =?UTF-8?q?Table=20=E7=9A=84=20autoimport=20=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vite/index.ts | 5 ++++- src/types/auto-imports.d.ts | 2 ++ src/views/system/mail/account/account.data.ts | 2 +- src/views/system/mail/account/index.vue | 3 +-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build/vite/index.ts b/build/vite/index.ts index 304ce0d5..53f66ec0 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -39,11 +39,14 @@ export function createVitePlugins(VITE_APP_TITLE: string) { imports: [ 'vue', 'vue-router', + // 可额外添加需要 autoImport 的组件 { '@/hooks/web/useI18n': ['useI18n'], - '@/hooks/web/useXTable': ['useXTable'], '@/hooks/web/useMessage': ['useMessage'], + '@/hooks/web/useXTable': ['useXTable'], '@/hooks/web/useVxeCrudSchemas': ['useVxeCrudSchemas'], + '@/hooks/web/useTable': ['useTable'], + '@/hooks/web/useCrudSchemas': ['useCrudSchemas'], '@/utils/formRules': ['required'], '@/utils/dict': ['DICT_TYPE'] } diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 7c9f5ff1..75cf16d9 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -52,6 +52,7 @@ declare global { const triggerRef: typeof import('vue')['triggerRef'] const unref: typeof import('vue')['unref'] const useAttrs: typeof import('vue')['useAttrs'] + const useCrudSchemas: typeof import('@/hooks/web/useCrudSchemas')['useCrudSchemas'] const useCssModule: typeof import('vue')['useCssModule'] const useCssVars: typeof import('vue')['useCssVars'] const useI18n: typeof import('@/hooks/web/useI18n')['useI18n'] @@ -60,6 +61,7 @@ declare global { const useRoute: typeof import('vue-router')['useRoute'] const useRouter: typeof import('vue-router')['useRouter'] const useSlots: typeof import('vue')['useSlots'] + const useTable: typeof import('@/hooks/web/useTable')['useTable'] const useVxeCrudSchemas: typeof import('@/hooks/web/useVxeCrudSchemas')['useVxeCrudSchemas'] const useXTable: typeof import('@/hooks/web/useXTable')['useXTable'] const watch: typeof import('vue')['watch'] diff --git a/src/views/system/mail/account/account.data.ts b/src/views/system/mail/account/account.data.ts index 24017dc0..31856296 100644 --- a/src/views/system/mail/account/account.data.ts +++ b/src/views/system/mail/account/account.data.ts @@ -1,4 +1,4 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { DictTag } from '@/components/DictTag' import { TableColumn } from '@/types/table' import { dateFormatter } from '@/utils/formatTime' diff --git a/src/views/system/mail/account/index.vue b/src/views/system/mail/account/index.vue index ec88d60b..bb1a0a2a 100644 --- a/src/views/system/mail/account/index.vue +++ b/src/views/system/mail/account/index.vue @@ -53,13 +53,12 @@