https://github.com/wangpin34/vue-scroll
Scroll directive on vue
https://github.com/wangpin34/vue-scroll
directive scroll vuejs vuejs2
Last synced: 5 months ago
JSON representation
Scroll directive on vue
- Host: GitHub
- URL: https://github.com/wangpin34/vue-scroll
- Owner: wangpin34
- License: mit
- Archived: true
- Created: 2016-03-29T03:56:03.000Z (over 9 years ago)
- Default Branch: 2.0-compatible
- Last Pushed: 2023-01-05T00:04:18.000Z (over 2 years ago)
- Last Synced: 2025-01-19T06:05:59.421Z (5 months ago)
- Topics: directive, scroll, vuejs, vuejs2
- Language: JavaScript
- Homepage:
- Size: 607 KB
- Stars: 245
- Watchers: 10
- Forks: 88
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-scroll
scroll directive for [vuejs 2.0](https://vuejs.org/v2/guide/)
For vue 1.x, please use [email protected]. Currently its code is in master branch.
[](https://nodei.co/npm/vue-scroll/)
[](https://travis-ci.org/wangpin34/vue-scroll)
[](https://coveralls.io/github/wangpin34/vue-scroll)[](https://www.npmjs.org/package/vue-scroll)
[](https://npmjs.org/package/vue-scroll)
[](http://isitmaintained.com/project/wangpin34/vue-scroll "Average time to resolve an issue")## Installation
### NPM(recommended)
```
npm install vue-scroll --save
```
### Standalone
**Standalone bundle is not support on latest v2.1.0 currently**Simple download from [releases](https://github.com/wangpin34/vue-scroll/releases) and include it in script tag.
## Get started
```javascript
import Vue from 'vue'
import vuescroll from 'vue-scroll'Vue.use(vuescroll)
```Directive v-scroll then can be used in any of your Component.
```App.vue
...
```
Method onScroll receives two arguments once scroll event is fired,
* e - event
* position - Object contains scrolling data
- scrollTop Number
- scrollLeft Number
## Advanced
throttle and debounce are supported since v2.1.0, you can enable it as global configurations like:
```javascript
Vue.use(vuescroll, {throttle: 600})
//Or
Vue.use(vuescroll, {debounce: 600})
```
Override global configurations like
```html
```
```html
```
## Demo
You please try the demo hosted on codesandbox: https://codesandbox.io/s/vuescroll-demo-orders-view-f4d3d?fontsize=14
## LICENSE
MIT