需求是这样的
改造前:
改造后:
上代码:
formData: {
parmDate: '',
onArea: '',
onSquare: '',
onMoney: '',
otherMoney: '',
onYearLong: '',
onAddDate: '',
freeDate: '',
eleMax: '',
otherCondition: ''
},
submit(form) {
this.$refs.baseForm.validate().then(res => {
console.log('表单数据信息:', res);
res.eleMax = this.formData.eleMax
res.otherCondition = this.formData.otherCondition
let arr = Object.entries(res).map(([key, value]) => ({
label: key,
value,
type: 'String'
}));
console.log(arr);
}).catch(err => {
console.log('表单错误信息:', err);
})
}