refactor(baInput):调整类型定义细节

This commit is contained in:
妙码生花 2024-06-29 16:07:50 +08:00
parent f6603f0f69
commit 58fd2a2528
3 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ export const inputTypes = [
'icon',
'color',
]
export type modelValueTypes = string | number | boolean | object
export type ModelValueTypes = string | number | boolean | object
export interface InputData {
// 内容,比如radio的选项列表数据,格式为对象或者数组:{ a: '选项1', b: '选项2' } or [{value: 1, label: 2, disabled: false}, {...}]

View File

@ -3,7 +3,7 @@ import { isArray } from 'lodash-es'
import type { PropType, VNode } from 'vue'
import { computed, createVNode, defineComponent, reactive, resolveComponent } from 'vue'
import { getArea } from '/@/api/common'
import type { InputAttr, InputData, modelValueTypes } from '/@/components/baInput'
import type { InputAttr, InputData, ModelValueTypes } from '/@/components/baInput'
import { inputTypes } from '/@/components/baInput'
import Array from '/@/components/baInput/components/array.vue'
import BaUpload from '/@/components/baInput/components/baUpload.vue'
@ -44,7 +44,7 @@ export default defineComponent({
const attrs = { ...props.attr, ...props.data }
//
const onValueUpdate = (value: modelValueTypes) => {
const onValueUpdate = (value: ModelValueTypes) => {
emit('update:modelValue', value)
}

View File

@ -2,7 +2,7 @@
import { formItemProps } from 'element-plus'
import type { PropType, VNode } from 'vue'
import { createVNode, defineComponent, resolveComponent } from 'vue'
import type { InputAttr, InputData, modelValueTypes } from '/@/components/baInput'
import type { InputAttr, InputData, ModelValueTypes } from '/@/components/baInput'
import { inputTypes } from '/@/components/baInput'
import BaInput from '/@/components/baInput/index.vue'
import type { FormItemAttr } from '/@/components/formItem'
@ -59,7 +59,7 @@ export default defineComponent({
}
}
const onValueUpdate = (value: modelValueTypes) => {
const onValueUpdate = (value: ModelValueTypes) => {
emit('update:modelValue', value)
}