I am using vuejs I want to get total amount in a table which contains quantity, unit price and their totals. Now I want to get their total after looping the database elements and using v-if to get certain elements. How do I do this...thanks in advance. This is my code
<table id="example1" class="table table-bordered table-striped table-hover">
<thead>
<th>Decription</th>
<th>Quantity</th>
<th>Unit price</th>
<th>Total</th>
<th>Create on</th>
</thead>
<tbody>
<tr v-for="item, key in pass" v-if="list.quotation_no === item.quotation_id">
<td>{{ item.description }}</td>
<td>{{ item.quantity }}</td>
<td>{{ item.unit_price }}</td>
<td>{{ item.quantity * item.unit_price }}</td>
<td>{{ item.created_at }}</td><br>
</tr>
</tbody>
</table>
my json response is like below
{
id : '5df323620a6f9635fc45b58f',
agentId : "agent-1",
captureTime : "2019-12-13T05:36:25Z",
locId : '513',
orgId : '1',
saleItems : [{
"code" : "7373631",
"name" : "Eyeshadw Patina",
"objectId" : "2f51acb2",
activities : [
{
"price" : '1400',
"qty" : '1',
"ts" : "1576215385000"
},
],
},
],
sessionId : "13086",
stationId : "11",
tenderItems : {
"106923bc" : {
activities : [
{
"amount" : "4408",
"ts" : "1576215571000"
}
],
code: "CA",
description : "+INR_CURRENCY",
objectId : "106923bc"
}
}
}, { id : '5df323620a6f9635fc45b58f', agentId : "agent-2", captureTime : "2019-12-13T05:36:25Z", locId : '513', orgId : '1', saleItems : [{
"code" : "7373631",
"name" : "Eyeshadw Patina",
"objectId" : "2f51acb2",
activities : [
{
"price" : '1400',
"qty" : '1',
"ts" : "1576215385000"
},
],
}]
}, { id : '5df323620a6f9635fc45b58f', agentId : "agent-3", captureTime : "2019-12-13T05:36:25Z", locId : '513', orgId : '1', saleItems : [{
"code" : "7373631",
"name" : "Eyeshadw Patina",
"objectId" : "2f51acb2",
activities : [
{
"price" : '1400',
"qty" : '1',
"ts" : "1576215385000"
},
],
}]
}