feat(pagination): dispatch button click events to be consistent with PaginationNav

This commit is contained in:
Eric Y Liu 2021-03-19 06:44:58 -07:00
commit 32effacb76
4 changed files with 24 additions and 4 deletions

View file

@ -1,6 +1,8 @@
<script>
/**
* @event {{ pageSize: number; page: number; }} update
* @event {{ page: number; }} click:button--previous
* @event {{ page: number; }} click:button--next
*/
/** Specify the current page index */
@ -162,6 +164,7 @@
: ''}"
on:click="{() => {
page--;
dispatch('click:button--previous', { page });
}}"
/>
<Button
@ -177,6 +180,7 @@
: ''}"
on:click="{() => {
page++;
dispatch('click:button--next', { page });
}}"
/>
</div>