https://github.com/yst138451/vue-hoverable
@yst/vue-hoverable · Lightweight Vue utility for listening to mouse hover.
https://github.com/yst138451/vue-hoverable
hover mouse-tracking vue
Last synced: 10 months ago
JSON representation
@yst/vue-hoverable · Lightweight Vue utility for listening to mouse hover.
- Host: GitHub
- URL: https://github.com/yst138451/vue-hoverable
- Owner: yst138451
- License: mit
- Created: 2020-01-29T18:42:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T05:54:55.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T19:05:22.274Z (11 months ago)
- Topics: hover, mouse-tracking, vue
- Language: JavaScript
- Homepage:
- Size: 1.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-hoverable
Lightweight Vue utility for listening to mouse hover (`mouseenter` and `mouseleave`).
## Installation
#### NPM
```bash
$ npm install @yst/vue-hoverable
```
#### Yarn
```bash
$ yarn add @yst/vue-hoverable
```
Import and install it as plugin:
```js
import Vue from 'vue';
import Hoverable from '@yst/vue-hoverable';
Vue.use(Hoverable);
```
## Options
### Scoped slots
#### `on.hover`
- type: `boolean`
Provides an info of the current mouse state ("entering" or "leaving").
## Usage
It doesn't wrap the target element/component with another one, because these mouse events are attached directly onto the target. So in the following case, the button will have mouse-hover and click handlers attached to it.
```html
Click me
```