var vm = new Vue({
el: '#app',
data() {
return {
options:[
{},
{},
{}
],
province_id:'',
city_id:'',
district_id:'',
dialogTableVisible: false,
dialogFormVisible: false,
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
formLabelWidth: '120px'
};
},
create(){
},
methods:{
open($id,$param){
this.gettype($id,$param)
},
gettype($id,$param,$p,$c,$d){
axios.post('/admin/shoporder/get_type', {
id: $id
}).then(res=>{
if($param==2){
this.city_id=''
this.district_id=''
}
if($param==3){
this.district_id=''
}
Vue.set(this.options,$param,res.data.data)
this.dialogFormVisible = true
if($p){
this.province_id=$p
}
})
if($p){
axios.post('/admin/shoporder/get_type', {
id: $p
}).then(res=>{
Vue.set(this.options,2,res.data.data)
if($c){
this.city_id=$c
}
})
}
if($c){
axios.post('/admin/shoporder/get_type', {
id: $c
}).then(res=>{
Vue.set(this.options,3,res.data.data)
if($d){
this.district_id=$d
}
})
}
},
}
})
vue实现多个select
最新推荐文章于 2023-07-26 16:29:04 发布