import type { PropType, ExtractPropTypes } from 'vue'; import type { InputAlign, InputLabelPosition, SizeType } from '../../types/global'; /** * form-item 表单item Props */ export const FormItemProps = { /** 自定义根节点样式 */ customStyle: { type: [String, Object] as PropType>, default: () => ({}) }, /** 自定义根节点样式类 */ customClass: { type: String as unknown as PropType, default: '' }, /** input的label提示语 */ label: { type: String, default: '' }, /** 绑定的值 */ prop: { type: String, default: '' }, /** 是否显示表单域的下划线边框 */ borderBottom: { type: [String, Boolean] as PropType, default: '' }, /** label的位置,left-左边,top-上边 */ labelPosition: { type: String as PropType, default: '' }, /** label的宽度,单位rpx */ labelWidth: { type: [String, Number] as PropType, default: '' }, /** label的样式,对象形式 */ labelStyle: { type: Object as PropType>, default: () => ({}) }, /** label字体的对齐方式 */ labelAlign: { type: String as PropType, default: '' }, /** 右侧图标 */ rightIcon: { type: String, default: '' }, /** 左侧图标 */ leftIcon: { type: String, default: '' }, /** 左侧图标的自定义前缀 */ leftIconPrefix: { type: String, default: 'uicon' }, /** 右侧图标的自定义前缀 */ rightIconPrefix: { type: String, default: 'uicon' }, /** 左侧图标的样式 */ leftIconStyle: { type: Object as PropType>, default: () => ({}) }, /** 右侧图标的样式 */ rightIconStyle: { type: Object as PropType>, default: () => ({}) }, /** 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置 */ required: { type: Boolean, default: false }, /** 表单内组件的大小,仅支持预设值 default/small/large */ size: { type: String as PropType, default: '' } }; export type FormItemProps = ExtractPropTypes;