@beisen-phoenix/mobile-input

表单组件:单行文本。

Usage no npm install needed!

<script type="module">
  import beisenPhoenixMobileInput from 'https://cdn.skypack.dev/@beisen-phoenix/mobile-input';
</script>

README

表单组件:单行文本。

概述

用于表单中的单行文本字段

API

参数 说明 类型 默认值
labelText 标题 string
value 指定输入框当前值 any
defaultValue 输入框初始值 any
placeholder 输入框没有值时的帮助文字 string 点击填写
required 是否必填 boolean false
readOnly 是否只读 boolean false
rightEl 右侧区域元素 用于显示单位或者图标 string/React.ReactNode
hasError 当前字段验证是否出现错误 用于显示底部错误红线 boolean false
labelIcon 自定义字段图标 展示于标题右侧 大小为 16px*16px React.ReactNode

多语言

参数 说明 类型 默认值
translation 语言包 用于翻译组件内置常量 {inputHolder: string} {inputHolder: '点击填写'}

事件

参数 说明 类型 默认值
onFocus 输入框获取焦点时的回调 (e: React.FocusEvent) => void
onChange 输入框内容变化时的回调 (e: React.ChangeEvent) => void
onBlur 输入框失去焦点时的回调 (e: React.FocusEvent) => void