Skip to content

Input 输入框

规则

js
{
    type:"input",
    title:"商品名称",
    field:"goods_name",
    value:"iphone 7",
    props: {
        type: "text",
    },
    validate:[
        { required: true, message: '请输入goods_name', trigger: 'blur' },
    ],
}
{
    type:"input",
    title:"商品名称",
    field:"goods_name",
    value:"iphone 7",
    props: {
        type: "text",
    },
    validate:[
        { required: true, message: '请输入goods_name', trigger: 'blur' },
    ],
}

参考:Ant-design-vue_Input

value :String

Props

参数说明类型默认值
addonAfter带标签的 input,设置后置标签string|slot
addonBefore带标签的 input,设置前置标签string|slot
disabled是否禁用状态,默认为 falsebooleanfalse
id输入框的 idstring
maxLength最大长度number
prefix带有前缀图标的 inputstring|slot
size控件大小。注:标准表单内的输入框大小限制为 large。可选 large default smallstringdefault
suffix带有后缀图标的 inputstring|slot
typetext,textarea,search 和其他 原生 input 的 type 值stringtext
allowClear可以点击清除图标删除内容boolean

Input 事件

事件名称说明回调参数
change输入框内容变化时的回调function(e)
pressEnter按下回车的回调function(e)

TextArea

参数说明类型默认值
autosize自适应内容高度,可设置为 true|false 或对象:{ minRows: 2, maxRows: 6 }boolean|objectfalse
defaultValue输入框默认内容string
allowClear可以点击清除图标删除内容boolean

TextArea 事件

事件名称说明回调参数
pressEnter按下回车的回调function(e)
参数说明类型默认值
enterButton是否有确认按钮,可设为按钮文字。该属性会与 addon 冲突。boolean|slotfalse
loading搜索 loadingboolean

Search 事件

事件名称说明回调参数
search点击搜索或按下回车键时的回调function(value, event)

其余属性和 Input 一致。

Released under the MIT License.