From bbcedd02baa053a88688a82fc72e87c857c82db2 Mon Sep 17 00:00:00 2001 From: dhb52 <dhb52@126.com> Date: 星期三, 03 一月 2024 11:40:39 +0800 Subject: [PATCH] fix: 修复vscode全局属性ts爆红问题 参照vuejs官方文档,[扩展全局属性](https://cn.vuejs.org/guide/typescript/options-api.html#augmenting-global-properties), --- src/types/module.d.ts | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/types/module.d.ts b/src/types/module.d.ts index 0e0490e..984df9f 100644 --- a/src/types/module.d.ts +++ b/src/types/module.d.ts @@ -1,18 +1,24 @@ -import type modal from '@/plugins/modal'; -import type tab from '@/plugins/tab'; -import type download from '@/plugins/download'; -import type animate from '@/animate'; -import type { useDict } from '@/utils/dict'; -import type { addDateRange, handleTree, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; -import type { getConfigKey, updateConfigByKey } from '@/api/system/config'; -import type { download as rd } from '@/utils/request'; +import modal from '@/plugins/modal'; +import tab from '@/plugins/tab'; +import download from '@/plugins/download'; +import auth from '@/plugins/auth'; +import cache from '@/plugins/cache'; +import animate from '@/animate'; +import { useDict } from '@/utils/dict'; +import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; +import { getConfigKey, updateConfigByKey } from '@/api/system/config'; +import { download as rd } from '@/utils/request'; -declare module '@vue/runtime-core' { +export {}; + +declare module 'vue' { interface ComponentCustomProperties { // 鍏ㄥ眬鏂规硶澹版槑 $modal: typeof modal; $tab: typeof tab; $download: typeof download; + $auth: typeof auth; + $cache: typeof cache; animate: typeof animate; useDict: typeof useDict; @@ -26,3 +32,8 @@ parseTime: typeof parseTime; } } + +declare module 'vform3-builds' { + const content: any; + export = content; +} -- Gitblit v1.9.3