feat:创建表单数据的组件增加自定义输入框属性选项

This commit is contained in:
妙码生花 2023-03-15 12:20:24 +08:00
parent 2e7e4b8945
commit f8f4fe6063

View File

@ -12,6 +12,7 @@
:placeholder="t('Please input field', { field: form.name.title })"
:input-attr="{
onChange: updateValue,
...props.options?.name?.inputAttr,
}"
prop="name"
/>
@ -23,6 +24,7 @@
:placeholder="t('Please input field', { field: form.title.title })"
:input-attr="{
onChange: updateValue,
...props.options?.title?.inputAttr,
}"
prop="title"
/>
@ -35,6 +37,7 @@
:placeholder="t('Please select field', { field: form.type.title })"
:input-attr="{
onChange: updateValue,
...props.options?.type?.inputAttr,
}"
prop="type"
/>
@ -47,6 +50,7 @@
rows: 3,
placeholder: t('utils.One line at a time, without quotation marks, for example: key1=value1'),
onChange: updateValue,
...props.options?.dict?.inputAttr,
}"
prop="dict"
@keyup.enter.stop=""
@ -59,6 +63,7 @@
:placeholder="t('Please input field', { field: form.tip.title })"
:input-attr="{
onChange: updateValue,
...props.options?.tip?.inputAttr,
}"
prop="tip"
/>
@ -71,6 +76,7 @@
:placeholder="t('Please select field', { field: form.rule.title })"
:input-attr="{
onChange: updateValue,
...props.options?.rule?.inputAttr,
}"
prop="rule"
/>
@ -82,6 +88,7 @@
:input-attr="{
onChange: updateValue,
placeholder: t('utils.One attribute per line without quotation marks(formitem)'),
...props.options?.extend?.inputAttr,
}"
prop="extend"
@keyup.enter.stop=""
@ -94,6 +101,7 @@
:input-attr="{
onChange: updateValue,
placeholder: t('utils.Extended properties of Input, one line without quotation marks, such as: size=large'),
...props.options?.inputExtend?.inputAttr,
}"
prop="inputExtend"
@keyup.enter.stop=""
@ -106,6 +114,7 @@ import { reactive } from 'vue'
import FormItem from '/@/components/formItem/index.vue'
import { inputTypes } from '/@/components/baInput'
import { validatorType } from '/@/utils/validate'
import { InputAttr } from '/@/components/baInput'
import { i18n } from '/@/lang'
const { t } = i18n.global
@ -115,6 +124,8 @@ type OptionItem = {
show?: boolean
// 使props.dataTitle + title title 使 title
title?: string
//
inputAttr?: InputAttr
}
type ValidatesOptionItem = Omit<OptionItem, 'value'> & {