如何访问 v-data-table current page 和 items-per-page 来计算行索引?
How to access v-data-table current page and items-per-page to calculate rows index?
如何获取 v-data-table
当前页面值和选定的 items-per-page
值以便在我的组件模板中使用它?
我需要访问这两个变量来计算和显示行索引。
<v-data-table
dense
:headers="headers"
:items="items"
:footer-props="{
'items-per-page-options': [10, 50, 100]
}"
:items-per-page="50"
>
<template #item.index="{ index }">
<div class="text-caption text-right">
{{ index + 1 }}.
</div>
</template>
</v-data-table>
每当 table 的分页发生变化时,都会触发一个 pagination
event。有效负载包含当前 page
和 itemsPerPage
.
如何获取 v-data-table
当前页面值和选定的 items-per-page
值以便在我的组件模板中使用它?
我需要访问这两个变量来计算和显示行索引。
<v-data-table
dense
:headers="headers"
:items="items"
:footer-props="{
'items-per-page-options': [10, 50, 100]
}"
:items-per-page="50"
>
<template #item.index="{ index }">
<div class="text-caption text-right">
{{ index + 1 }}.
</div>
</template>
</v-data-table>
每当 table 的分页发生变化时,都会触发一个 pagination
event。有效负载包含当前 page
和 itemsPerPage
.