data() {
return {
options2: [{
label: ‘江苏‘,
cities: [{label:‘南京‘},{label:‘a‘},{label:‘b‘}]
}, {
label: ‘浙江‘,
cities: [{label:‘杭州‘}]
}],
props: {
value: ‘label‘,
children: ‘cities‘
}
};
},
methods: {
handleItemChange(val) {
/* console.log(‘active item:‘, val);
console.log(val[0]) */
setTimeout(_ => {
this.options2.map((item,index)=>{
if(item.label==val[0]){
/* console.log(item.cities) */
this.options2[index].cities=
item.cities
}
})
}, 300);
}
}