1. Change the values in the array
paraList: [
{
txt:'123',chose:false},
{
txt:'1234',chose:false}
]
let choseChange = "paraList[" + index + "].chose"
this.setData({
[choseChange]: true
})
Note: You do not need to write this.data for the string of the selected array. !!!
You can change the value of a specific subscript in the array
2. Change the value in the object
navbarData: {
isfixed: false,
iswhite: false, //icon color
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '客户列表', //导航栏 中间的标题
backgroundcolor: '#fff',
isintercept: false, //返回拦截
},
let title = 'navbarData.title'
this.setData({
[title]: '组员客户',
})