You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-scroll

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-scroll

scroll directive for vuejs

2.0.0
Source
npmnpm
Version published
Maintainers
1
Created
Source

vue-scroll

scroll directive for vuejs 2.0

For vue 1.x, please use vue-scroll@1.0.4 or higher version. Currently its code is in master branch.

NPM

Installation

NPM(recommended)

npm install vue-scroll --save

Standlone

Simple download and include it in script tag.

Usage

It's very simple, just declar in html tags and provide a defined callback - the scroll function below.

In javasript:

new Vue({
  el: '#app',
  data: {},
  methods:{
    onScroll:function(e, position){
      this.position = position;
    }
  }
})

The function onScroll has two arguments, e is the scroll event object, position is an object which has two properties about the postion of scroll bar:

  • scrollTop type:number
  • scrollLeft type:number

In html:

<body v-scroll="onScroll">
...
</body>

Samples

LICENSE

MIT

Keywords

vue

FAQs

Package last updated on 02 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts