mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
Merge branch 'master' of https://github.com/IBM/carbon-components-svelte
This commit is contained in:
commit
a38166ad39
1 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,13 @@
|
||||||
import CaretRight24 from 'carbon-icons-svelte/lib/CaretRight24';
|
import CaretRight24 from 'carbon-icons-svelte/lib/CaretRight24';
|
||||||
import { cx, fillArray } from '../../lib';
|
import { cx, fillArray } from '../../lib';
|
||||||
import Select, { SelectItem } from '../Select';
|
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);
|
$: totalPages = Math.max(Math.ceil(totalItems / pageSize), 1);
|
||||||
$: selectItems = fillArray(totalPages);
|
$: selectItems = fillArray(totalPages);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue