|
17 | 17 | | `itemsToScroll` | `number` | 1 | Number of slides to move when navigating. Useful for creating slide groups. |
|
18 | 18 | | `itemsToShow` | `number` \| 'auto' | 1 | Number of slides visible simultaneously. Use 'auto' for variable width slides. |
|
19 | 19 | | `modelValue` | `number` | 0 | Controls the active slide index. Can be used with v-model for two-way binding. |
|
20 |
| -| `mouseDrag` | `boolean` \| `object` | true | Enables/disables mouse drag navigation. When passed as an object, can contain a `threshold` property to control the drag distance required to trigger a slide transition. E.g. `{ threshold: 0.5 }`| |
| 20 | +| `mouseDrag` | `boolean` \| `DragConfig` | true | Enables/disables mouse drag navigation. See [Drag Options](#drag-options) for configuration details. | |
21 | 21 | | `mouseScroll` | `boolean` | false | Enables/disables mouse wheel scrolling for carousel navigation. |
|
22 | 22 | | `mouseScrollThreshold` | `number` | 10 | Controls the sensitivity threshold for mouse scrolling. Higher values require more scrolling. |
|
23 | 23 | | `pauseAutoplayOnHover` | `boolean` | false | When true, autoplay pauses while the mouse cursor is over the carousel. |
|
24 | 24 | | `preventExcessiveDragging` | `boolean` | false | Limits dragging behavior at carousel boundaries for better UX. <Badge text="0.13.0" /> |
|
25 | 25 | | `slideEffect` | 'slide', 'fade' | 'slide' | Determines the transition effect between slides. |
|
26 | 26 | | `snapAlign` | 'start', 'end', 'center-odd', 'center-even' | 'center' | Determines how slides are aligned within the viewport. |
|
27 |
| -| `touchDrag` | `boolean` | true | Enables/disables touch navigation on touch-enabled devices. | |
| 27 | +| `touchDrag` | `boolean` \| `DragConfig` | true | Enables/disables touch navigation on touch-enabled devices. See [Drag Options](#drag-options) for configuration details. | |
28 | 28 | | `transition` | `number` | 300 | Duration of the slide transition animation in milliseconds. |
|
29 | 29 | | `wrapAround` | `boolean` | false | When true, creates an infinite loop effect by connecting the last slide to the first. |
|
30 | 30 |
|
|
34 | 34 |
|
35 | 35 | > **Drag Prevention**: The `preventExcessiveDragging` option is automatically disabled when `wrapAround` is enabled, as boundary restrictions aren't needed in infinite loop mode.
|
36 | 36 |
|
| 37 | +## Drag Options |
| 38 | + |
| 39 | +Both `mouseDrag` and `touchDrag` properties accept either a boolean value or a `DragConfig` object with the following properties: |
| 40 | + |
| 41 | +| Property | Type | Default | Description | |
| 42 | +|-------------|----------|---------|--------------------------------------------------------------------------------------------| |
| 43 | +| `threshold` | `number` | 0.3 | Controls the drag distance required to trigger a slide transition, as a fraction of slide width. Higher values require more dragging to trigger a slide change. | |
| 44 | + |
| 45 | +### Example |
| 46 | + |
| 47 | +```vue |
| 48 | +<template> |
| 49 | + <Carousel |
| 50 | + :mouseDrag="{ threshold: 0.5 }" |
| 51 | + :touchDrag="{ threshold: 0.7 }" |
| 52 | + > |
| 53 | + <!-- Slides --> |
| 54 | + </Carousel> |
| 55 | +</template> |
| 56 | +``` |
| 57 | + |
37 | 58 | ## Slots
|
38 | 59 |
|
39 | 60 | ### Slides/Default
|
|
0 commit comments