Socket
Socket
Sign inDemoInstall

vue-scroll

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-scroll

scroll directive for vuejs


Version published
Weekly downloads
20K
increased by10.18%
Maintainers
1
Install size
9.52 kB
Created
Weekly downloads
 

Readme

Source

vue-scroll

scroll directive for vuejs

NPM

Installation

NPM(recommended)

npm install vue-scroll --save-dev

You need to load it manually.

const Vue = require('vue')
const vScroll = require('vue-scroll')
Vue.use(vScroll)

Standlone

Simple download and include it in script tag. And it will be auto loaded into vue.

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>

Plain sample

LICENSE

MIT

Keywords

FAQs

Last updated on 06 May 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc