前端拷贝API封装 话不多说,直接上代码 deepClone(obj) { var deepObj = {}; deepObj = JSON.parse(JSON.stringify(obj)); //this.templateData是父组件传递的对象 return deepObj; } }