# vue3-image-compare-slider
**Repository Path**: zerokwok/vue3-image-compare-slider
## Basic Information
- **Project Name**: vue3-image-compare-slider
- **Description**: A simple image compare slider component for Vue 3, supporting zooming, dragging and fit modes.
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-08-24
- **Last Updated**: 2025-08-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# vue3-image-compare-slider
A simple image compare slider component for Vue 3, supporting zooming, dragging and fit modes.
## Features
- Supports zooming, dragging, and slider position adjustment
- Supports fit modes (1:1, contain, scale-down)
## Installation
```bash
npm install vue3-image-compare-slider
```
## Usage
### Global Registration
```js
import { createApp } from 'vue'
import ImageCompareSlider, { install } from 'vue3-image-compare-slider'
const app = createApp(App)
app.use(install)
```
### Usage in Components
```vue
```
## Props
| Prop | Type | Default | Description |
| ---------- | ------- | --------------------- | -------------------- |
| left | String | Required | Left image URL |
| right | String | Required | Right image URL |
| zoom | Number | 100 | Zoom percentage |
| zoomRange | Object | {min:10,max:400,step:10} | Zoom range settings |
## Slots
None
## Events
| Event Name | Description | Callback Parameters |
| --------------- | -------------------------- | ------------------- |
| update:zoom | Triggered on zoom change | New zoom value |
## Methods
Callable via `ref`:
| Method | Description | Parameters |
| -------------- | -------------------------- | ------------------ |
| setFitMode | Set the fit mode | '1:1' \| 'contain' \| 'scale-down' |
## Example
View the complete example in [examples/App.vue](examples/App.vue).
## Preview
Run the example