对象属性合并
合并对象
this.info = {…this.info,…dataObj)
它会将this.info和dataObj的所有属性合并,如果有重复的,优先取后边dataObj的。最后整合后提交给this.info
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 小贺同学的blog!
评论
this.info = {…this.info,…dataObj)
它会将this.info和dataObj的所有属性合并,如果有重复的,优先取后边dataObj的。最后整合后提交给this.info