在 Vue 中,当直接通过索引赋值来更改数组中的元素时,Vue 无法检测到这种变化,因此不会触发视图更新。
this.form.money[0] = { money: '100.99', num: '3' }
解决方法:使用 Vue.set 或 this.$set 来确保 Vue 可以监听到数组元素的变化。
Vue.set
this.$set
Vue
this.$set(this.form.money, 0, { money: '100.99', num: '3' })
京公网安备 11010502049817号