调用接口的数据怎么转成数组
1个回答
展开全部
<text class="numberli" wx:for="{{opencode[index]}}" wx:key="opencode">{{item}}</text>
js:
success: function(res) {
var arrs = [];
res.data.data.map(function(item){
arrs.push(item.data.opencode.split(','))
}),
that.setData({
opencode:arrs,
}),
console.log(arrs);
}
js:
success: function(res) {
var arrs = [];
res.data.data.map(function(item){
arrs.push(item.data.opencode.split(','))
}),
that.setData({
opencode:arrs,
}),
console.log(arrs);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询