vue-scroll-stop
A tiny Vue directive that stop propagation scroll when edge reached.
Works with desktop mousewheel
and mobile touchmove
events
✅ On | ❌ Off |
---|---|
![]() |
![]() |
Sandbox
Want to try? Here's a link.
Installation
npm i --save vue-scroll-stop
Import
In main.js:
Vue el: '#app'
Browser
Include the script file, then install the component with Vue.use(VueScrollStop);
e.g.:
Usage
Once installed, it can be used in a template as simply:
By default directive works on both direction but you can strict it by using modifier v (vertical) or h (horizontal)
<!-- Works only for horizontal scroll -->
You can pass false
as value to disable directive reactive
<!-- Directive disabled -->