原先的
this.addForm.strPrice = resPrice.result.strPrice this.addForm.price = resPrice.result.price this.addForm.priceId = resPrice.result.priceId
现在的只需一句代码搞定
Object.assign(this.addForm, resPrice.result)
减少代码冗余,提高项目的可维护性。
标签:price,Object,addForm,resPrice,js,result,assign From: https://www.cnblogs.com/clsoft/p/17434816.html