let obj = JSON.parse(JSON.stringify(data));
例如,table列表中,点击编辑时,可对val进行如上操作来解除双向绑定
<el-table ref="tables" :data="tableData" style="width: 100%" empty-text="暂无数据" stripe highlight-current-row @current-change="handleCurrentChange">
</el-table>
handleCurrentChange(val) {
// 判断是否有选中的行
this.currentRow = val
//替换为
this.currentRow = JSON.parse(JSON.stringify(val))
},