2👍
✅
Instead of computed
you want methods
:
methods: {
priceNet(price) {
return price / 1.23
},
pricePerItem(price, amount) {
return price / amount
}
},
then, in your html update the bindings:
<tr v-for="(element, index) in amount">
<td>{{ element.amount }}</td>
<td>{{ priceNet(element.price) | curr }}</td>
<td>
{{ element.price | curr }}
{{ pricePerItem(element.price, element.amount) | curr }}
</td>
</tr>
Updated fiddle:
Source:stackexchange.com