可以先将一个对象变成json字符串再转对象
this.dataB = JSON.parse(JSON.stringify(this.dataA));
this.dataB.a = 5;
console.log( this.dataA.a);//返回1
console.log( this.dataB.a);//返回5
留作记录,参考https://blog.csdn.net/jiangwei1994/article/details/83068944
可以先将一个对象变成json字符串再转对象
this.dataB = JSON.parse(JSON.stringify(this.dataA));
this.dataB.a = 5;
console.log( this.dataA.a);//返回1
console.log( this.dataB.a);//返回5
留作记录,参考https://blog.csdn.net/jiangwei1994/article/details/83068944