取数据遇到7层循环的尴尬(ajax,vuejs)
qwest.get(url).then(processRequest(function(data) {
self.mountain_dropdown.options = data.map(function(mountain) {
mountain.text =
mountain.name;
mountain.value =
mountain.id;
self.season_dropdown.options = mountain.seasonList.map(function(season){
season.text =
season.name;
season.value =
season.id;
self.position_dropdown.options = season.positionList.map(function(position){
position.text =
position.name;
position.value =
position.id;
self.craft_dropdown.options = position.craftList.map(function(craft){
craft.text =
craft.name;
craft.value =
craft.id;
self.maker_dropdown.options = craft.makerList.map(function(maker){
maker.text =
maker.name;
maker.value =
maker.id;
self.step1Len = maker.processList.length;
self.dropdown_options = maker.processList.map(function(process){
process.text = process.ratio;
process.value =
process.id;
return process;
});
return maker;
});
return craft;
});
return position;
});
return season;
});
return mountain;
});
for(var i=0;i<self.step1Len;i++){
self.step1.push({list:false});
}
}));