在components中引入联动的json文件
import ProvinceData from '../../../../../json/area.json';
在this.state中定义相应变量
constructor(props){
super(props);
this.state = {
active: 'male',
mapconfig:{
center: { lat: 42.872, lng: 3.644},
zoom: 3
},
curOption: {
province:'',
city:'',
county:'',
job:'',
edu:''
},
//联动省级市数据
deepProvince:null,
deepCity:null
};
this.changeTab = this.changeTab.bind(this);
this.chgActive = this.chgActive.bind(this);
this.chgOption = this.chgOption.bind(this);
写联动的方法
//drop 改变active
chgActive(key) {