DropDownList使用说明
项目运行
-
cnpm install 或 npm install cnpm使用教程
-
npm run dev (开发环境打包 port:8080)
-
npm run test (测试用例)
-
npm run build (生产环境打包)
DropDownList参数
const props = {
title: '',
placeholder:'',
defaultValue: '',
errorStatus: false,
errorMsg: '出错了~~~!',
helpMsg: '',
hasClosebtn: true,
multiple: true,
limitCount:5,
hasInput: true,
showInput: true,
lablePos: true,
lableTxt: false,
children: [
{
value: 0,
text: '查看详情',
isActive: false,
isChecked: false,
tipText: "哎哎多撒多撒<br/>多撒多撒多所"
}
],
hidden: false,
hasEmptyData: true,
autoShowPanel: true,
showPanel: false,
disabled: false,
readonly: false,
required: true,
iconName: 'pc-sys-arrowdown-nomal-svg',
onClick: function (event, target, val) { console.log(val) },
onBlur: function (event, val) { console.log(val) },
onChange: function (event, target, val) { console.log(event); console.log(target); console.log(val); },
onFocus: function (event, val) {
console.log('focuse')
self.test2()
},
onClose: function (status) { console.log(status) }
}
DropDownList调用方法
1.安装npm组件包
npm install @beisen/dropdown-list --save-dev
2.引用组件
import DropDownList from "@beisen/dropdown-list"
3.传入参数
该参数为上述参数,传入方式使用: {...参数}
{
"title":"title"
,"defaultValue":"111111"
,"errorStatus": false
,"errorMsg":"出错了~~~!"
,"helpMsg":"312321"
,"hasSearch":false
,"PromptMsg":"PromptMsg"
,"hasClosebtn":true
,"limitCount": 5
,"multiple": true
,"hasInput": true
,"showInput": true
,"lablePos": true
,"lableTxt": false
,"children":[
{
"value":0
,"text":"查看详情"
,"isActive":false
,"isChecked":false
}
,{
"value":1
,"text":"性质维度"
,"isActive":false
,"isChecked":false
,"onlyShowInput":true
}
,{
"value":2
,"text":"地域维度"
,"isActive":false
,"isChecked":false
}
,{
"value":3
,"text":"包含下aaaaaaaaaaaaaaaaaaaaa属"
,"isActive":false
,"isChecked":false
}
,{
"value":4
,"text":"包含下属"
,"isActive":false
,"isChecked":false
},{
"value":5
,"text":"包含下属1"
,"isActive":false
,"isChecked":false
} ,{
"value":6
,"text":"包含下属2"
,"isActive":false
,"isChecked":false
} ,{
"value":7
,"text":"包含下属3"
,"isActive":false
,"isChecked":false
} ,{
"value":8
,"text":"包含下属4"
,"isActive":false
,"isChecked":false
} ,{
"value":9
,"text":"包含下属5"
,"isActive":false
,"isChecked":false
} ,{
"value":10
,"text":"包含下属6"
,"isActive":false
,"isChecked":false
} ,{
"value":11
,"text":"包含下属7"
,"isActive":false
,"isChecked":false
}
]
,"hidden":false
,'autoShowPanel':true
,"showPanel": false
,"disabled":false
,"readonly":false
,"required":true
,"iconName":"pc-sys-arrowdown-nomal-svg"
,"onClick":function(event, target, val){console.log(val)}
,"onBlur":function(event, val){console.log(val)}
,"onChange":function(event, target, val){console.log(event);console.log(target);console.log(val);}
,"onFocus":function(event, val){
console.log('focuse')
self.test2();
}
,"onClose":function(status){console.log(status)}
}
render () {
return (
<DropDownList {...this.state.DropDownData} />
)
}