Update docs
This commit is contained in:
@@ -146,15 +146,14 @@ Navigates to a page by index
|
||||
|
||||
Arguments:
|
||||
|
||||
| Prop | Type | Default | Description |
|
||||
| Argument | Type | Default | Description |
|
||||
|--------------------|-------------|---------|---------------------------------------|
|
||||
| `pageIndex` | `number` | | Page number |
|
||||
| `options.animated` | `boolean` | `true` | Should be animated or not |
|
||||
| `options.animated` | `boolean` | `true` | Should it be animated or not |
|
||||
|
||||
```jsx
|
||||
<script>
|
||||
// ...
|
||||
|
||||
let carousel;
|
||||
function goToStartPage() {
|
||||
carousel.goTo(0, { animated: false })
|
||||
|
||||
@@ -186,6 +186,8 @@
|
||||
## Use case
|
||||
<AlbumsPreview />
|
||||
|
||||
<Divider />
|
||||
|
||||
# Installation
|
||||
```bash
|
||||
yarn add svelte-carousel
|
||||
@@ -202,7 +204,10 @@ Import component
|
||||
</script>
|
||||
```
|
||||
|
||||
<Divider />
|
||||
|
||||
# Props
|
||||
|
||||
<div class="table-wrapper">
|
||||
|
||||
| Prop | Type | Default | Description |
|
||||
@@ -220,7 +225,9 @@ Import component
|
||||
|
||||
</div>
|
||||
|
||||
# Event
|
||||
<Divider />
|
||||
|
||||
# Events
|
||||
|
||||
## `pageChange`
|
||||
Is dispatched on page change
|
||||
@@ -243,6 +250,8 @@ Is dispatched on page change
|
||||
</Carousel>
|
||||
```
|
||||
|
||||
<Divider />
|
||||
|
||||
# Slots
|
||||
|
||||
## `prev` and `next`
|
||||
@@ -329,6 +338,41 @@ Slot props:
|
||||
|
||||
<Divider />
|
||||
|
||||
# Methods
|
||||
|
||||
## `goTo`
|
||||
Navigates to a page by index
|
||||
|
||||
Arguments:
|
||||
|
||||
<div class="table-wrapper">
|
||||
|
||||
| Argument | Type | Default | Description |
|
||||
|--------------------|-------------|---------|---------------------------------------|
|
||||
| `pageIndex` | `number` | | Page number |
|
||||
| `options.animated` | `boolean` | `true` | Should it be animated or not |
|
||||
|
||||
</div>
|
||||
|
||||
```jsx
|
||||
<script>
|
||||
// ...
|
||||
let carousel;
|
||||
function goToStartPage() {
|
||||
carousel.goTo(0, { animated: false })
|
||||
}
|
||||
</script>
|
||||
|
||||
<Carousel
|
||||
bind:this={carousel}
|
||||
>
|
||||
<!-- -->
|
||||
</Carousel>
|
||||
<button class="button" on:click={goToStartPage}>Go</button>
|
||||
```
|
||||
|
||||
<Divider />
|
||||
|
||||
<style>
|
||||
.img-container {
|
||||
display: block;
|
||||
|
||||
Reference in New Issue
Block a user