vueでドロップダウンリストに動的値を追加する
1135 ワード
axiosでバックグラウンドからデータを取得する
取得した値をドロップダウン・ボックスで巡回
data(){
return{
name:' ',
comments:[],
comment:{},
centerDialogVisible: false ,
form:{},
list:[] // ,
}
},
created(){
this.reloadData();
this.getUrl(); //
},
methods:{
getUrl(){
axios.get('/order/findAll')
.then((response)=>{
console.log('get :',response.data.data);
//
for(let i in response.data.data){
this.list.push(response.data.data[i]); //this vue
}
console.log('list ',this.list);
})
}
}
取得した値をドロップダウン・ボックスで巡回