[LayaAir 2.0]dialog 里的数据已经获取到了,也赋值了但是页面没跟新,addChild好像无效果
var fooddata = [];
for (var X = 0; X < res.data.length; X++) {
var foodid = res.data[X]['n_food_id'];
var foodtxt = res.data[X]['n_number'];
fooddata[X] = {
food: { skin: 'comp/food' + foodid + '.png' },
food_txt: { text: foodtxt }
// console.log();
}
}
console.log('+++++++++++++++++++')
console.log(_super);
console.log(fooddata);
self.foodList.dataSource = fooddata;
//实例化角色容器
var foodBox = new Laya.Sprite();
//添加到舞台上
console.log(self.foodBox);
Laya.stage.addChild(foodBox);
self.foodBox = fooddata;
console.log(self.foodBox);
for (var X = 0; X < res.data.length; X++) {
var foodid = res.data[X]['n_food_id'];
var foodtxt = res.data[X]['n_number'];
fooddata[X] = {
food: { skin: 'comp/food' + foodid + '.png' },
food_txt: { text: foodtxt }
// console.log();
}
}
console.log('+++++++++++++++++++')
console.log(_super);
console.log(fooddata);
self.foodList.dataSource = fooddata;
//实例化角色容器
var foodBox = new Laya.Sprite();
//添加到舞台上
console.log(self.foodBox);
Laya.stage.addChild(foodBox);
self.foodBox = fooddata;
console.log(self.foodBox);
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
X.
赞同来自:
X.
赞同来自:
何吓吓
赞同来自: