diff --git a/apps/web-ele/src/adapter/component/index.ts b/apps/web-ele/src/adapter/component/index.ts index 9c5dcb9116b..80d3455b9ff 100644 --- a/apps/web-ele/src/adapter/component/index.ts +++ b/apps/web-ele/src/adapter/component/index.ts @@ -12,6 +12,7 @@ import { globalShareState } from '@vben/common-ui'; import { $t } from '@vben/locales'; import { + type CheckboxProps, ElButton, ElCheckbox, ElCheckboxGroup, @@ -27,6 +28,7 @@ import { ElTimePicker, ElTreeSelect, ElUpload, + type RadioProps, } from 'element-plus'; const withDefaultPlaceholder = ( @@ -39,12 +41,6 @@ const withDefaultPlaceholder = ( }; }; -type TKV = { - [key: string]: any; - label: string; - value: any; -}; - // 这里需要自行根据业务组件库进行适配,需要用到的组件都需要在这里类型说明 export type ComponentType = | 'Checkbox' @@ -75,11 +71,8 @@ async function initComponentAdapter() { { ...props, attrs }, props.options ? () => - props.options?.map((option: TKV) => { - return h(ElCheckbox, { - label: option.label, - value: option.value, - }); + props.options?.map((option: CheckboxProps) => { + return h(ElCheckbox, { ...option }); }) : slots, ); @@ -101,11 +94,8 @@ async function initComponentAdapter() { { ...props, attrs }, props.options ? () => - props.options?.map((option: TKV) => { - return h(ElRadio, { - label: option.label, - value: option.value, - }); + props.options?.map((option: RadioProps) => { + return h(ElRadio, { ...option }); }) : slots, );