I have some products that I have created an array for showing them with VueJS & every product that user chooses goes to a list and every time that clicks on the products, It will increment the "Count" value. Every "Count" value times to the "Price" & writes "Total Price", But this "TotalPrice" is for just a product. So my question is that how can I plus all "TotalPrice" from all products to show the user Total Price ? I should o that with "For Loop" ?
Persons: [
{Name: 'Ali', Family: 'Bahaari', Age: 20, Count: 0, Price: 200},
{Name: 'Akbar', Family: 'Jahan', Age: 30, Count: 0, Price: 2500},
{Name: 'Amir', Family: 'Pirozi', Age: 40, Count: 0, Price: 500},
{Name: 'Reza', Family: 'Khosravi', Age: 50, Count: 0, Price: 100}
]
<tr v-for="Active in Activated">
<td>{{ Active.Name }}</td>
<td>{{ Active.Family }}</td>
<td>{{ Active.Age }}</td>
<td>{{ Active.Count }}</td>
<td>{{ Active.Price }}</td>
<td>{{ Active.Count * Active.Price }}</td>
</tr>