antd-carlencarmodal-select
v1.1.0
Published
### 安装包 `npm install antd-carlencarmodal-select`
Downloads
15
Readme
antd-region-select
安装包
npm install antd-carlencarmodal-select
示例
import RegionSelect from 'antd-carlencarmodal-select'
class App extends Component {
constructor(props){
super(props)
this.state = {
carLenCarModal:{},
valueName:"",
regionItem:{}
}
}
onCarInfoChange(valueObj,selectVal){
console.log(valueObj)
console.log(selectVal)
this.setState({
regionItem:valueObj,
valueName:selectVal
})
}
/*
获取车长车型 公共接口返回数据格式
data:[
0:{
lengthConfig:{},
modelConfig:{}
}
]
*/
async getCarInfo(){
let response = await getCarConfig();
this.fetresult(response).then(() => {
let lengthConfig = response.data;
this.setState({
carLenCarModal: lengthConfig,
})
}).catch((res) => {
this.setState({
carLenCarModal: {},
})
})
}
render() {
return (
<div>
{/*
判断carLenCarModal有数据
*/}
{Object.keys(this.state.carLenCarModal).length != 0 &&
<CarLenModalSelect
baseData={this.state.carLenCarModal}
val={this.state.regionItem}
showClear={true}
onCarInfoChange={(valueObj,selectVal) => {
this.onCarInfoChange(valueObj,selectVal)
}}
>
<Input placeholder="请选择车辆信息" value={this.state.valueName} readOnly />
</CarLenModalSelect>
}
</div>
);
}
}
演示