mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
refactor(baInput):调整类型定义细节
This commit is contained in:
parent
f6603f0f69
commit
58fd2a2528
@ -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}, {...}]
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user