数组为:
basicInfos: [
{ label: '采购商租户', value: '', span: '8', xlSpan: '4' },
{ label: '采购商名称', value: '', span: '8', xlSpan: '6' },
{ label: '登录账号', value: '', span: '8', xlSpan: '4' },
{ label: '供应商编码', vale: '', span: '8', xlSpan: '4' },
{ label: '三证合一码', value: '', span: '8', xlSpan: '4' },
{ label: '状态', value: '', span: '8', xlSpan: '2' },
],
现对数组中的每一个value进行初始化赋值,Lodash有比较优雅的方法赋值吗?现在赋值实现是这样的:
this.basicInfos[0].value = supplierAndPurchaseDto.tenantId
this.basicInfos[1].value = supplierAndPurchaseDto.enterpriseName
this.basicInfos[2].value = supplierAndPurchaseDto.loginAccount
this.basicInfos[3].value = supplierAndPurchaseDto.partner
this.basicInfos[4].value = supplierAndPurchaseDto.licenseCode
this.basicInfos[5].value = supplierAndPurchaseDto.supplierStatusName