Textarea
项目简介
本项目为textarea文本输入框。对本项目有任何疑问或建议,欢迎联系~(邮箱:mengshuai@beisen.com)
项目运行
-
cnpm install 或 npm install
-
npm run dev (开发环境打包、项目启动,默认端口 port:8080)
-
npm run test (测试用例)
-
npm run build (生产环境打包)
Textarea参数
const props = {
hidden: false,
disabled: false,
readOnly: false,
maxlength: 140,
defaultHeight: '130px',
labeltext: '默认title',
required: true,
textValue: '',
placeHolder:'',
showStatus: '',
showText: '请填写正确',
helpMsg: 'dqwdq',
sideTip: false,
hiddenTip: false,
errorStatus: false,
errorMsg: '出错了~~~!',
lablePos: true,
lableTxt: false,
onClick: function (event) {
console.log(event.target.value)
},
onFocus: function (event) {
console.log(event.target.value)
},
onChange: function (event) {
console.log(event.target.value)
},
onBlur: function (event) {
console.log(event.target.value)
},
iconClick: function () {
console.log(0)
}
}
调用方法
1.安装npm组件包
npm install @beisen/text-area --save-dev
2.引用组件
import Textarea from "@beisen/text-area"
3.传入参数
state = {
hidden: false
,disabled: false
,readOnly: false
,maxlength: 10
,labeltext: "默认title"
,required: true
,textValue: 'DCSDCDSCSDDCSDCDSCSD'
,"showStatus":""
,"showText":"请填写正确"
,"helpMsg":"dqwdq"
,"sideTip":false
,"hiddenTip":false
,"errorStatus": false
,"errorMsg":"出错了~~~!"
,"lablePos": true
,"lableTxt": false
,onClick:function(event){console.log(event.target.value)}
,onFocus:function(event){console.log(event.target.value)}
,onChange:function(event){console.log(event.target.value)}
,onBlur:function(event){console.log(event.target.value)}
}
render () {
return (
<div>
<Textarea {...this.state} />
</div>
)
}