mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
Merge pull request #185 from mabentley85/pagination-event-forwarding
Added Event Forwarding To Pagination Component
This commit is contained in:
commit
5e205719eb
1 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,13 @@
|
|||
import CaretRight24 from 'carbon-icons-svelte/lib/CaretRight24';
|
||||
import { cx, fillArray } from '../../lib';
|
||||
import Select, { SelectItem } from '../Select';
|
||||
import { afterUpdate, createEventDispatcher } from 'svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
afterUpdate(() => {
|
||||
dispatch('update', {pageSize: parseInt(pageSize), page: parseInt(page)});
|
||||
});
|
||||
|
||||
$: totalPages = Math.max(Math.ceil(totalItems / pageSize), 1);
|
||||
$: selectItems = fillArray(totalPages);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue