vueはandroid,mintにおけるpopupとpickerを結合して省市街地の3級連動を実現する
template:
data:
watch:
created:
methods:
style:
//
:
{{provinceName}}-{{cityName}}-{{countyName}}
data:
//
myAddressSlots1: [{
flex: 1,
values: [{
name: " ",
id: "1"
}], //
textAlign: 'center'
}],
//
myAddressSlots2: [{
flex: 1,
values: [{
name: "[ ]",
id: "1"
}, ],
textAlign: 'center'
}],
//
myAddressSlots3: [{
flex: 1,
values: [{
name: "[ ]",
id: "1"
}],
textAlign: 'center'
}],
watch:
//
watch: {
funding() {
if (this.funding) {
this.$refs.arrow.style.transform = "rotate(-270deg)"
} else {
this.$refs.arrow.style.transform = "rotate(-90deg)"
}
},
regionVisible() {
if (this.regionVisible) {
this.$refs.arrow1.style.transform = "rotate(-270deg)"
} else {
this.$refs.arrow1.style.transform = "rotate(-90deg)"
}
},
},
created:
// android
this.province = $App.getProvinceList()
this.province = JSON.parse(this.province)
this.myAddressSlots1[0].values = this.province;
methods:
addressChange1(msg, value) {
this.provinceId = value[0].id;
this.provinceName = value[0].name;
this.city = $App.getCityList(this.provinceId);
this.city = JSON.parse(this.city);
this.myAddressSlots2[0].values = this.city;
},
addressChange2(msg, value) {
this.cityId = value[0].id;
this.cityName = value[0].name;
this.county = $App.getCountryList(this.cityId);
this.county = JSON.parse(this.county);
this.county.unshift({
name: "[ ]",
id: 0
})
this.myAddressSlots3[0].values = this.county;
},
addressChange3(msg, value) {
this.countyId = value[0].id;
this.countyName = value[0].name;
},
style: