diff --git a/src/components/ConfigGlobal/src/ConfigGlobal.vue b/src/components/ConfigGlobal/src/ConfigGlobal.vue index 4594ebd..5bd90cf 100644 --- a/src/components/ConfigGlobal/src/ConfigGlobal.vue +++ b/src/components/ConfigGlobal/src/ConfigGlobal.vue @@ -1,7 +1,7 @@ diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 8c66a49..fa22379 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia' import { store } from '../index' import { setCssVar, humpToUnderline } from '@/utils' -import { ElMessage } from 'element-plus' +import { ElMessage, ComponentSize } from 'element-plus' import { useCache } from '@/hooks/web/useCache' const { wsCache } = useCache() @@ -26,8 +26,8 @@ interface AppState { title: string userInfo: string isDark: boolean - currentSize: ElementPlusSize - sizeMap: ElementPlusSize[] + currentSize: ComponentSize + sizeMap: ComponentSize[] mobile: boolean footer: boolean theme: ThemeTypes @@ -156,10 +156,10 @@ export const useAppStore = defineStore('app', { getIsDark(): boolean { return this.isDark }, - getCurrentSize(): ElementPlusSize { + getCurrentSize(): ComponentSize { return this.currentSize }, - getSizeMap(): ElementPlusSize[] { + getSizeMap(): ComponentSize[] { return this.sizeMap }, getMobile(): boolean { @@ -245,7 +245,7 @@ export const useAppStore = defineStore('app', { } wsCache.set('isDark', this.isDark) }, - setCurrentSize(currentSize: ElementPlusSize) { + setCurrentSize(currentSize: ComponentSize) { this.currentSize = currentSize wsCache.set('currentSize', this.currentSize) }, diff --git a/src/views/Components/Form/UseFormDemo.vue b/src/views/Components/Form/UseFormDemo.vue index 7e11c39..c32116f 100644 --- a/src/views/Components/Form/UseFormDemo.vue +++ b/src/views/Components/Form/UseFormDemo.vue @@ -4,7 +4,7 @@ import { ContentWrap } from '@/components/ContentWrap' import { useI18n } from '@/hooks/web/useI18n' import { useForm } from '@/hooks/web/useForm' import { reactive, unref, ref } from 'vue' -import { ElButton, ElInput, FormItemProp } from 'element-plus' +import { ElButton, ElInput, FormItemProp, ComponentSize } from 'element-plus' import { useValidator } from '@/hooks/web/useValidator' import { getDictOneApi } from '@/api/common' @@ -113,7 +113,7 @@ const changeLabelWidth = (width: number | string) => { }) } -const changeSize = (size: string) => { +const changeSize = (size: ComponentSize) => { setProps({ size }) diff --git a/types/global.d.ts b/types/global.d.ts index 31eddfa..fe4b285 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -17,8 +17,6 @@ declare global { declare type TimeoutHandle = ReturnType declare type IntervalHandle = ReturnType - declare type ElementPlusSize = 'default' | 'small' | 'large' - declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger' declare type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'