@beisen-phoenix/field-textarea

@beisen-phoenix/field-textarea

Usage no npm install needed!

<script type="module">
  import beisenPhoenixFieldTextarea from 'https://cdn.skypack.dev/@beisen-phoenix/field-textarea';
</script>

README

文本框组件

@beisen-phoenix/field-textarea

概述

高度自适应,默认3行,最小1行,最大5行
若传入autoHeight为true,则没有最大高度的限制
若用户通过右下角图标拖拽过文本域的大小,则高度不再自适应,只能由用户拖拽控制

API

参数 说明 类型 默认值 是否必传
value 已输入的值 string No
disabled 该输入项是否禁用 boolean false No
hasError 是否显示错误 boolean false No
isPreview 是否用于表单展示态 boolean false No
placeholder 输入框的占位符 string No
size 文本域尺寸,仅支持 default large No
minLength 最少字数,不传表示不显示 number No
maxLength 最大字数,不传表示不显示 number No
autoHeight 是否有最大高度的限制,默认状态下最大高度为5行 boolean false No
allowResize 是否允许用户通过右下角图标拖拽大小 boolean true No
onChange 文本域内容变化时的回调,负责将值传回form (data) => void No
onFocus 获取焦点时的回调 function(value: string) - No
onBlur 失去焦点时的回调 function(value: string) - No
onClick 鼠标点击文本域的回调 function(event) - No
onPaste 粘贴事件的回调函数 function(event) - No
onKeyDown 按下键盘的回调 function(event) - No

translation

translation: {
  placeholder: '请输入',
  minLengthBefore: '至少输入',
  minLengthAfter: '个字'
}