https://github.com/jackchoumine/petite-vue-hooks
A tiny vue hooks
https://github.com/jackchoumine/petite-vue-hooks
Last synced: 2 months ago
JSON representation
A tiny vue hooks
- Host: GitHub
- URL: https://github.com/jackchoumine/petite-vue-hooks
- Owner: jackchoumine
- License: mit
- Created: 2024-02-01T17:20:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-07T02:00:32.000Z (3 months ago)
- Last Synced: 2025-03-07T03:19:01.757Z (3 months ago)
- Language: TypeScript
- Size: 420 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# petite-vue-hooks
A tiny vue hooks as its name.
> It is wip. Don't use it in production.
## Features
## Installation
```bash
npm i petite-vue-hooks
# or yarn
yarn add petite-vue-hooks
# or pnpm
pnpm add petite-vue-hooks
```## Usage
### useDraggable
Make an element draggable.
#### base usage
Drag element in the whole window.
```html
import { useDraggable } from 'petite-vue-hooks'
const { setDragEle } = useDraggable()
Drag me```
#### set a drag area
You can set a drag area by `setExtentEle`
```html
import { useDraggable } from 'petite-vue-hooks'
const { setDragEle, setExtentEle } = useDraggable()
Drag me only in extent-draggable div
```