8 months ago

Sum up an attribute from children components

Posted 8 months ago by MiloudiMohamed

Hello I have two components supplies and supply I do a v-for inside the supplies so I create many of the supply children

  v-for="supply in supplies"

And inside the supply I can choose a quantity and multiply it by the supply.price to get the total

computed: {
  total () {
      return * this.quantity

What I want to know is how can I sum all the total from all the supply component

Thank you in advance

Please sign in or create an account to participate in this conversation.