Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/voxtobox/vue-scroll-stop

A tiny Vue directive that stop propagation scroll when edge reached
https://github.com/voxtobox/vue-scroll-stop

scroll scrolling vue vue-directive vue2 vuejs2

Last synced: 28 days ago
JSON representation

A tiny Vue directive that stop propagation scroll when edge reached

Awesome Lists containing this project

README

        

# vue-scroll-stop

A tiny Vue directive that stop propagation scroll when edge reached.
Works with desktop `mousewheel` and mobile `touchmove` events

:white_check_mark: On | :x: Off
------------- | -------------
![screenshot](vue-scroll-stop-on.gif) | ![screenshot](vue-scroll-stop-off.gif)

## Sandbox

Want to try? [Here's a link](https://jsfiddle.net/voxtobox/9ghLbek8/).

## Installation

```javascript
npm i --save vue-scroll-stop
```

### Import
In main.js:
```javascript
import Vue from 'vue'
import VueScrollStop from 'vue-scroll-stop'
import App from './App.vue'

Vue.use(VueScrollStop)

new Vue({
el: '#app',
render: h => h(App)
})
```

### Browser

Include the script file, then install the component with `Vue.use(VueScrollStop);` e.g.:

```html

Vue.use(VueScrollStop);

```

## Usage

Once installed, it can be used in a template as simply:
```html


```
By default directive works on both direction but you can strict it by using modifier v (vertical) or h (horizontal)
```html

```

You can pass `false` as value to disable directive reactive
```html


```