线上demo:https://stackblitz.com/edit/a...当点击iPhone时,颜色会变蓝色再点一次会变回黑色,这里使用this.betState[selectId]=!this.betState[selectId];然后按删除也可以把iPhone变成蓝色现在问题就是删除没有用我想是因为del()没有抓到正确的变量(this.betState)但是betThis()却抓的到很奇怪困扰很久了有人可以帮忙一下吗为什么del()抓不到正确的变量?bet.tsbetState={};betThis(selectId){this.betState[selectId]=!this.betState[selectId];console.log(this.betState)}del(id){this.betState[id]=falseconsole.log(this.betState)}bet.htmldeletecs.html {{list.test1.qq2[1]}}
app.compontent.htmldatatest=[{"test1":{"qq2":["o123","iPhone"],},}]
烙印99
叮当猫咪
相关分类