Skip to content

Input 输入框

Input 输入框打开
9:41
/pages/input/index

介绍

weui-input 是对 uni-app 原生 input 的 WeUI 样式封装,支持 v-model、输入类型、焦点、密码、确认按钮等常用能力。

基础用法

vue
<weui-cell title="标题">
  <template #right>
    <weui-input v-model="value" placeholder="请输入" />
  </template>
</weui-cell>

Props

属性说明类型默认值
modelValue输入值,支持 v-modelstring | number''
type输入类型,同 uni-app inputstring'text'
placeholder占位文字string''
disabled是否禁用booleanfalse
readonly是否只读booleanfalse
maxlength最大输入长度number | string140
focus是否自动聚焦booleanfalse
password是否密码输入booleanfalse
confirmType键盘确认按钮类型string'done'
placeholderStyle占位符样式string''
placeholderClass占位符 classstring''
cursorSpacing光标与键盘距离number | string0
cursor指定光标位置number | string-1
selectionStart选区起点number | string-1
selectionEnd选区终点number | string-1

Events

事件名说明回调参数
update:modelValue输入值变化value
input输入时触发event
change内容变化时触发event
confirm点击完成按钮时触发event
focus聚焦时触发event
blur失焦时触发event

Released under the MIT License.