1.1.18 • Published 5 years ago
antd-region-select v1.1.18
antd-region-select
安装包
npm install antd-region-select
示例
import RegionSelect from 'antd-region-select'
class App extends Component {
constructor(props){
super(props)
this.state = {
valueName:"",
regionItem:{
provinceId:null,
provinceName:null,
cityId:null,
cityName:null,
districtId:null,
districtName:null,
}
}
}
onAreaChange(valueObj,selectVal){
console.log(valueObj)
console.log(selectVal)
this.setState({
regionItem:valueObj,
valueName:selectVal
})
}
render() {
//获取省市区公共接口
//const regions = response.data[0].children
const regions = [{
"value": 32,
"label": "重庆",
"children": [{
"value": 394,
"label": "重庆",
"children": [{
"value": 3328,
"label": "永川区"
}]
}]
}]
return (
<RegionSelect
val={this.state.regionItem}
regions={regions}
showClear={false}
showCity={true}
showDistrict={true}
onAreaChange={(valueObj,selectVal) => {
this.onAreaChange(valueObj,selectVal)
}}
>
<Input placeholder="请选择装货地址" value={this.state.valueName} readOnly />
</RegionSelect>
);
}
}
演示
1.1.18
5 years ago
1.1.17
5 years ago
1.1.16
5 years ago
1.1.15
5 years ago
1.1.14
5 years ago
1.1.13
5 years ago
1.1.12
5 years ago
1.1.11
5 years ago
1.1.10
5 years ago
1.1.9
5 years ago
1.1.8
5 years ago
1.1.7
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.6
5 years ago
1.0.4
5 years ago
1.0.2
5 years ago