单击时,我要推送到数组。如果我在Google Chrome浏览器的控制台中手动刷新Vue扩展名,则可以正常使用
completeStep(index, key) {
let currentSet = index + key
if (this.exercise_completed[index].indexOf(currentSet) === -1) {
this.exercise_completed[index].push(currentSet)
} else {
this.exercise_completed[index].splice(this.exercise_completed[index].indexOf(currentSet), 1)
}
}
答案 0 :(得分:1)
答案 1 :(得分:1)
我建议制作一个键,并根据阵列中的更改来更改键。看这里: https://michaelnthiessen.com/force-re-render