Skip to content

输入框 Input ​

自研输入框,原生 <input> 实现,支持清除按钮。

Props

属性类型默认值说明
modelValuestring | number''绑定值(v-model)
placeholderstring''占位提示
typestring'text'输入框类型(text/password/number 等)
disabledbooleanfalse是否禁用
clearablebooleanfalse是否显示一键清除按钮

事件

事件参数说明
update:modelValuestring输入/清除时触发

示例

vue
<template>
  <Input v-model="keyword" placeholder="请输入关键词" clearable />
  <Input v-model="password" type="password" placeholder="密码" />
  <Input v-model="name" disabled />
</template>

Released under the MIT License.