Back to Taro

taro-textarea-core

packages/taro-components/src/components/textarea/readme.md

4.2.05.5 KB
Original Source

taro-textarea-core

API

属性类型默认值说明
valueString输入框的内容
placeholderString输入框为空时占位符
placeholder-styleString指定 placeholder 的样式
placeholder-classStringtextarea-placeholder指定 placeholder 的样式类
disabledBooleanfalse是否禁用
maxlengthNumber140最大输入长度,设置为 -1 的时候不限制最大长度
auto-focusBooleanfalse自动聚焦,拉起键盘。
auto-heightBooleanfalse高度自适应
focusBooleanfalse获取焦点
fixedBooleanfalse如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true
cursor-spacingNumber0指定光标与键盘的距离,单位 px 。取 textarea 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离
show-confirm-barBooleantrue是否显示键盘上方带有”完成“按钮那一栏
selection-startNumber-1光标起始位置,自动聚集时有效,需与 selection-end 搭配使用
selection-endNumber-1光标结束位置,自动聚集时有效,需与 selection-start 搭配使用
bindfocusEventHandle输入框聚焦时触发,height 参数在基础库 1.9.90 起支持
bindblurEventHandle输入框失去焦点时触发,
bindlinechangeEventHandle输入框行数变化时调用,
bindinputEventHandle当键盘输入时,触发 input 事件, bindinput 处理函数的返回值并不会反映到 textarea 上
bindconfirmEventHandle点击完成时, 触发 confirm 事件,
<!-- Auto Generated Below -->

Properties

PropertyAttributeDescriptionTypeDefault
autoFocusfocusbooleanfalse
autoHeightauto-heightbooleanfalse
disableddisabledbooleanfalse
maxlengthmaxlengthnumber140
namenamestringundefined
nativeProps--{}{}
placeholderplaceholderstringundefined
valuevaluestring''

Events

EventDescriptionType
blurCustomEvent<any>
changeCustomEvent<any>
confirmCustomEvent<any>
focusCustomEvent<any>
inputCustomEvent<any>
keydownCustomEvent<any>
linechangeCustomEvent<any>

Methods

focus() => Promise<void>

Returns

Type: Promise<void>


Built with StencilJS