Update readme

This commit is contained in:
Vadim
2021-06-30 23:47:30 +03:00
parent 92e7a4b76a
commit 538bfc52ea

View File

@@ -149,7 +149,7 @@ Arguments:
| Argument | Type | Default | Description |
|--------------------|-------------|---------|---------------------------------------|
| `pageIndex` | `number` | | Page number |
| `options.animated` | `boolean` | `true` | Should it be animated or not |
| `options.animated` | `boolean` | `true` | Should it be animated or not |
```jsx
<script>
@@ -167,3 +167,55 @@ Arguments:
</Carousel>
<button class="button" on:click={goToStartPage}>Go</button>
```
### `goToPrev`
Navigates to the previous page
Arguments:
| Argument | Type | Default | Description |
|--------------------|-------------|---------|---------------------------------------|
| `options.animated` | `boolean` | `true` | Should it be animated or not |
```jsx
<script>
// ...
let carousel;
function goToPrevPage() {
carousel.goToPrev({ animated: false })
}
</script>
<Carousel
bind:this={carousel}
>
<!-- -->
</Carousel>
<button class="button" on:click={goToPrevPage}>Go</button>
```
### `goToNext`
Navigates to the next page
Arguments:
| Argument | Type | Default | Description |
|--------------------|-------------|---------|---------------------------------------|
| `options.animated` | `boolean` | `true` | Should it be animated or not |
```jsx
<script>
// ...
let carousel;
function goToNextPage() {
carousel.goToNext({ animated: false })
}
</script>
<Carousel
bind:this={carousel}
>
<!-- -->
</Carousel>
<button class="button" on:click={goToNextPage}>Go</button>
```