Add pageChange event

This commit is contained in:
Vadim
2021-02-06 13:23:45 +03:00
parent b0d42f6e7a
commit 9928ed56a4
4 changed files with 51 additions and 1 deletions

View File

@@ -217,6 +217,29 @@ Import component and styles in App component
</div>
# Event
## `pageChange`
Is dispatched on page change
<div class="table-wrapper">
| Payload field | Type | Description |
|--------------------|-------------|---------------------------------------|
| `event.detail` | `number` | Current page index |
</div>
```jsx
<Carousel
on:pageChange={
event => console.log(`Current page index: ${event.detail}`)
}
>
<!-- -->
</Carousel>
```
# Slots
## `prev` and `next`