Input 输入框

字符输入控件

基础用法

尺寸

可清除的输入框

TIP

由于输入框并没有固定的宽度,如果需要防止抖动,你应该给输入框或者输入框的容器加上固定宽度

密码输入框

变体

前缀和后缀

组合输入框

搜索框

带有状态的输入框

Input API

Input Props

属性名描述类型默认值
type输入框类型enum原生类型text
size输入框的尺寸,仅在 type 不为"textraea"时有效enum——
v-model / modelValue输入框的尺寸,仅在 type 不为"textraea"时有效string/ number——
placeholder提示符string——
disabled是否禁用booleanfalse
showPassword是否显示密码booleanfalse
clearable输入框的值是否可以被清除booleanfalse
readonly是否为只读输入框booleanfalse
tabindex输入框的tabindexstring/ numberfalse
maxLength最大输入长度,同原生 maxlength 属性string/ number——
minLength最小输入长度,同原生 maxlength 属性string/ number——
max最大值,同原生 max 属性————
min最小值,同原生 min 属性————
suffixIcon前缀图标string/ Component——
prefixIcon后缀图标string/ Component——
showLimit是否显示字数,只在 type 为"text"和"textarea"时有效booleanfalse
autoFocus是否自动聚焦booleanfalse
rows字符行数,用原生 rows 属性number——
noResize不改变textarea的高度booleanfalse
afterBlur输入框失焦后的回调Function——
autoResize自动适应高度,仅在 type 为"textarea"时有效booleanfalse
variant样式变体enumoutlined

Input Emits

事件名描述类型
input输入时触发Function
change输入框的值发生变化时触发Function
clearValue清除输入框的值时触发Function
focus输入框聚焦时触发Function
blur输入框失焦时触发Function
compositionstart合成开始时触发Function
compositionupdate合成中字符被输入时触发Function
compositionend合成完成或取消时触发Function

Input Slots

插槽名描述
suffix输入框前缀内容
prefix输入框后缀内容
append输入框前置内容
prepend输入框后置内容

Input Exposes

属性名描述类型
inputRefinput 元素object
isFocused输入框聚焦状态boolean
focus输入框聚焦方法Function
blur输入框失焦方法Function
clearValue输入框清除值的方法Function
上次更新时间: