0.0.10 • Published 6 years ago
@beisen/upaas-textbox-search v0.0.10
@beisen/upaas-textbox-search
文本框的搜索态组件
默认需要的参数
/**必传参数
* @param {String} title 下拉按钮文本---必传
* @param {Function} onChange 组件对外onchange回调,this.props.onChange({text: '', value: ''}) ---必传
*/
/**可选参数
* @param {Boolean} hidden 显示或隐藏
* @param {Object} baseData : {
'bsStyle': 'default'
,'bsSize': 'small'
,'active': false
,'disabled': false
,'href': null /**如果该字段有定义且非空,return(<a/>),否则return(</button>)**/
,'title': '确定' /**显示文本(string)**/
,'hidden': false //是否显示按钮
,'maxWidth': '40px' //最大宽度,默认为"" ,超出后,超出的部门显示...
}
* @param {Object} textContent: {
"showTag":""
,"defaultValue":""
,"placeHolder":"请输入文本"
,"errorStatus":false
,"showText":""
,"errorMsg":"出错了~~~!"
,"symbol":"" //符号,为空时没有符号
,"helpMsg":""
,"sideTip":false //toolTip是否左右显示
,"hiddenTip":false //toolTip是否显示
,"hidden":false
,"disabled":false
,"readonly":false
,"required":false
*/
- 使用demo
import TextboxSearch from '@beisen/upaas-textbox-search';
class Demo extends Component{
constructor(props){
super(props);
this.state = {
"title": "技术" //下拉按钮文本--》必填
,onChange: function(obj) {
console.log(obj, "获得文本框中的值")
} //必填
/*下边的都选填*/
,hidden: false
//按钮数据
,baseData: {
'bsStyle': 'default'
,'bsSize': 'small'
,'active': false
,'disabled': false
,'href': null /**如果该字段有定义且非空,return(<a/>),否则return(</button>)**/
,'title': '确定' /**显示文本(string)**/
,'hidden': false //是否显示按钮
,'maxWidth': '40px' //最大宽度,默认为"" ,超出后,超出的部门显示...
}
//文本框数据
,textContent: {
"showTag":""
,"defaultValue":""
,"placeHolder":"请输入文本"
,"errorStatus":false
,"showText":""
,"errorMsg":"出错了~~~!"
,"symbol":"" //符号,为空时没有符号
,"helpMsg":""
,"sideTip":false //toolTip是否左右显示
,"hiddenTip":false //toolTip是否显示
,"hidden":false
,"disabled":false
,"readonly":false
,"required":false
}
}
}
render () {
return (
<div style={{width: '50px'}}>
<TextboxSearch {...this.state}/>
</div>
)
}
}