原数据
editFormData: { column_info_list: [ { 'code': '', 'title': '', 'operate_type': 'openWeb', 'more_info': { 'url': '' } } ], }
现在要修改 more-info 里url的值
let current = JSON.parse(JSON.stringify(this.editFormData.column_info_list[index])) current.more_info.url = 'newValue……' //splice也可以触发数据响应式 this.editFormData.column_info_list.splice(index,1,current) //或者使用 this.$set(this.editFormData.column_info_list, index, current) // 如果修改对象里的值 this.$set(this.editFormData, 'customedId', 1133)
原数据:
editFormData: { card_action_list: [{ code: '', text: '', url: '' }] }
this.editFormData.card_action_list[index].url = this.integralLink
官网: https://cn.vuejs.org/v2/guide/list.html#%E6%95%B0%E7%BB%84%E6%9B%B4%E6%96%B0%E6%A3%80%E6%B5%8B