SuperAPI AI 工具集

el-input

通用与其它

查看项目

更新于 10-15 23:32

技能介绍

用途:el-input 是 Element Plus 的输入框组件,用于通过鼠标或键盘录入文本数据。当需要实现文本输入框、自适应高度文本域、可切换可见性的密码输入、前后缀图标或内容、输入校验与格式化、输入长度限制时,可调用该技能。

主要能力:支持 text、textarea、password、number、email、search、tel、url 多种类型;提供 large、default、small 尺寸;支持一键清空(clearable)、密码显隐切换(show-password)、字数统计(show-word-limit)、文本域自适应高度(autosize)、值格式化与解析(formatter/parser)、前后缀图标(prefix-icon/suffix-icon)以及 prepend/append 复合输入。

使用方式:通过 v-model 绑定值,可配合 v-model.lazy、v-model.number、v-model.trim 修饰符;常用属性包括 type、maxlength、minlength、placeholder、disabled、size、rows、autosize、readonly、resize、autofocus、validate-event 等。事件有 blur、focus、change、input、clear、keydown、mouseenter、mouseleave;插槽有 prefix、suffix、prepend、append、password-icon(后四者仅在非 textarea 类型生效);暴露方法包括 blur、clear、focus、select、resizeTextarea 及 input、ref、textarea、textareaStyle、isComposing 等引用。

适用场景:表单文本录入、搜索框、密码框、金额格式化输入、带前后缀的复合输入,以及与 el-form 校验配合使用。

限制与注意:clearable 图标出现时输入框宽度可能变化,可设置固定宽度;文本域高度问题可用 autosize 解决;中文输入法场景可用 isComposing 判断组合状态。资料未提供收费、价格与平台信息。