Within my Vue.js data, I have a component that generates form inputs. You can view a live version of this component here. The data structure is as follows:
data: {
providerData: {
archive_cost: {
legend: 'Warehouse cost',
fields: {
monthly_room: {
label: 'Monthly cost of room',
value: '200',
unit: '$'
},
monthly_maintance: {
label: 'Monthly maintenance cost',
value: '10',
unit: '$'
},
summary: {
label: 'Summary cost',
value: '',
unit: '$',
disabled: true
}
}
}
},
},
I need the value of 'summary' to be the sum of 'monthly_room' and 'monthly_maintenance'. Is there a way to do this without using computed values for each individual field, considering there are about 20 similar values in this form that need to be handled separately by the component?