修改 数组 删除数据 修改某个数组 index
修改对象 修改对象 属性
that.setData({
'task_obj.state':1
}) console.log(e.detail);//e.detail.client e.detail.phone
const { index, client, phone, address, remark } = e.detail;
this.setData({
[`xiaoshouHeadList[${index}].client`]: client,
[`xiaoshouHeadList[${index}].phone`]: phone,
[`xiaoshouHeadList[${index}].address`]: address,
[`xiaoshouHeadList[${index}].remark`]: remark,
edit_show: false
});
const { index, client, phone, address, remark } = e.detail; 等价于
const index = e.detail.index;
const client = e.detail.client;
const phone = e.detail.phone;
const address = e.detail.address;
const remark = e.detail.remark; del_content_img(e) {
console.log(e.currentTarget.dataset.index);
var index = e.currentTarget.dataset.index;
// 创建一个新数组,不包含要删除的元素
var new_arr = this.data.content_img_list.filter((img, i) => i !== index);
// 更新数据
this.setData({
content_img_list: new_arr
});
},站长微信:xiaomao0055
站长QQ:14496453