0.1.7 • Published 3 years ago

shinemo-textarea v0.1.7

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

高度自适应文本输入框 / TextArea

高度自适应文本输入框

参数类型备注
defaultValueString默认输入框显示的值
valueString输入框的值
textClsString自定义输入框的样式名
conClsString自定义输入框容器的样式名
defValClsString输入框默认值的样式名
onChangeFunction输入框内容变更的回调
maxLenNumber输入框中文字数量
onLimitCountFunction输入框中超过限制时函数
onFocusFunction输入框获得焦点事件
onBlurFunction输入框失去焦点事件
autoFocusBoolean是否字段聚焦默认:false

用例

import React from 'react'
import ReactDOM from 'react-dom'
import Textarea from './components/textarea'


ReactDOM.render((<div style={{width: '400px', margin: '20px auto', border: '1px solid red'}}>
    <Textarea defaultValue="palce"
              value="这是测试的"
              onChange={
                  (val,e) => {
                  console.log(val,e)
                  }
              }
    />
</div>), document.getElementById('app'))