vue3-table-lite icon indicating copy to clipboard operation
vue3-table-lite copied to clipboard

Page Size prop isn't working?

Open gvinson opened this issue 2 years ago • 1 comments

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?

gvinson avatar Jul 01 '22 20:07 gvinson

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"
>

linmasahiro avatar Jul 02 '22 05:07 linmasahiro

Hi, @gvinson do you solve this problem? I am close this issue. If any questions, reopen it. thx.

linmasahiro avatar Sep 27 '22 00:09 linmasahiro