lanyun-field

介绍

用户可以在文本框内输入或编辑文字。

使用方法

import "../../components/lanyun-field/lanyun-field.stml";

例子

<lanyun-field
    @input="handleInput"
    @focus="handleFocus"
    @confirm="handleConfirm"
    type="text"
    label-width="27%"
    label="用户名"
    name="username"
    placeholder="请填写用户名"
    confirm-type="go"
    :error-message="usernameMessage"
/>

props 属性

参数 说明 类型 默认值
type 输入框类型, 选填, 可选值 text password string -
value 输入框的初始内容, 选填 string -
name 表单组件中的name作为key string -
placeholder 输入框为空时的占位字符, 选填 string -
autofocus 是否自动获取焦点, 选填 boolean false
disabled 是否禁用, 选填 boolean false
confirm-type 设置键盘右下角按钮的文字, 选填, 可选值 send search next go done string done
confirm-hold 点击键盘右下角按钮时是否保持键盘不收起, 选填 boolean false
error-message 错误信息, 选填 string -

events 事件

事件名 说明 回调参数
input 当键盘输入时触发 value:当前值
focus 输入框聚焦时触发 value:当前值, height: 键盘高度
blur 输入框失去焦点时触发 value:当前值
confirm 点击完成按钮时触发 value:当前值
是否仍需要帮助? 请保持联络!
最后更新于 2024/07/22