V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  wangkailang  ›  全部回复第 1 页 / 共 1 页
回复总数  1
2015-08-06 12:02:31 +08:00
回复了 xiaobetty 创建的主题 推广 晒出你最蠢的一段代码,送 Cherry 鼠标垫
取数据遇到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});
}
}));
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2776 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms · UTC 13:38 · PVG 21:38 · LAX 05:38 · JFK 08:38
Developed with CodeLauncher
♥ Do have faith in what you're doing.