vue3-table-lite
vue3-table-lite copied to clipboard
Page Size prop isn't working?
I have the following in place:
<vue-table-lite
:is-loading="table.isLoading"
:is-slot-mode="true"
:columns="table.columns"
:rows="table.rows"
:total="table.totalRecordCount"
:sortable="table.sortable"
:messages="table.messages"
:page-size="2"
@do-search="checkSearch"
@is-finished="busy = false"
>
But it is still showing 10 results per page, not 2. Should I be doing this another way?
Hi, @gvinson
Thanks for your question.
First, default page size always from 「page-options」 prop's first option, if haven't the prop, always will be 10.
And「page-size」 prop will be trigger after table initialization for developer to control page size use other method(ex: button, etc..) , because 「page-options」 prop default is [ { value: 10, text: 10 }, { value: 25, text: 25 }, { value: 50, text: 50 } ]
, and not include 2
.
So you should be use page-options to set page-size.
Try it!
<vue-table-lite
:is-loading="table.isLoading"
:is-slot-mode="true"
:columns="table.columns"
:rows="table.rows"
:total="table.totalRecordCount"
:sortable="table.sortable"
:messages="table.messages"
:page-size="2" // <<<< If it always 2, no required.
:page-options="[{ value: 2, text: 2}]"
@do-search="checkSearch"
@is-finished="busy = false"
>
Hi, @gvinson do you solve this problem? I am close this issue. If any questions, reopen it. thx.