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

@@ -44,6 +44,26 @@ Import component and styles in App component
| `autoplayDirection` | `string` | `'next'` | Auto play change direction (`next` or `prev`) |
| `dots` | `boolean` | `true` | Current page indicator dots |
# Event
## `pageChange`
Is dispatched on page change
| Payload field | Type | Description |
|--------------------|-------------|---------------------------------------|
| `event.detail` | `number` | Current page index |
```jsx
<Carousel
on:pageChange={
event => console.log(`Current page index: ${event.detail}`)
}
>
<!-- -->
</Carousel>
```
## Slots
### `prev` and `next`