Hi friends I am new to Vue. Pleas help me I am using vue2, vuetify 0.17 and datatable component. My problem is I want to take sum of area, floor columns from the data. I calculated the running total using map function and stored it in total{'area' : 100, 'floor':7}. Now in footer I want to display the totals.
<v-data-table
v-bind:headers="listData.columnProperty"
v-bind:items="listData.data"
v-bind:search="search"
:totals="{area : 100, flat : 7}" //is it allowed
>
<template slot="footer" slot-scope="totals">
Footer {{ totals}} {{ totals['area']}}
</template>
Please share any example which create a total and displays it into the footer. I need it badly.
答案 0 :(得分:1)
你说你用totals
计算了它,这样可行吗?
<template slot="footer">
<td><strong>Sum</strong></td>
<td class="text-xs-right">{{ totals.area }}</td>
<td class="text-xs-right">{{ totals.flat }}</td>
</template>
(不确定你的桌子看起来怎么样,但也许你明白了)