setData使用[...]进行动态key赋值,wxml如何获取?
原data
{
“arr”:[0,1,2],
}
js 处理业务流程:
var arr =[0,1,2];
for(var i = 0;i<arr.length;i++){
var key = “aaaa” + i;
this.setData({
[key] : “aaaaa”,
});
}
输出data结果是
{
“arr”:[0,1,2],
“aaaa0”:“aaaaaa”,
“aaaa1”:“aaaaaa”,
“aaaa2”:“aaaaaa”,
}
请问wxml如何循环arr调用 aaaa0/aaaa1/aaaa2?