修改數組指定元素
//數組
data: {
m_box: [{
title:'客戶',
}, {
title: '協同',
}, {
title: '敏捷',
}],
},
//操作
var id = 1;
var str_title = "m_box[" + id + "].title";
console.log(str_title ;
that.setData({
[str_title]:'實用',
})