[Vuejs]-Sum up an attribute from children components

0👍

Components can communicate to parents via events. Watch the ‘total’ computed property and emit an event with that value (E.G. $emit(‘total-changed’, total)). Then listen for that event and update the state (data) on the ‘supplies’ parent. I’ve generalized a lot, but there are many ways to do this. It would depend on your specific preference/needs.

Leave a comment