vue-smooth-scroll
Simple vue smooth scroll
111,967
76
| Install | |
|---|---|
npm install vue-smooth-scroll |
|
| Latest Version: | 1.0.13 |
| License: | MIT |
| Last Updated: | May 2, 2018 |
| Links: | GitHub · npm |
Maintainer: alamcordeiro
Vue Smooth Scroll
Simple vue smooth scroll based on vue-smoothscroll https://github.com/Teddy-Zhu/vue-smoothscroll/blob/master/README.md
Instalation
# install dependency
npm install --save vue-smooth-scroll
// import on your project (less then 1KB gziped)
import vueSmoothScroll from 'vue-smooth-scroll'
Vue.use(vueSmoothScroll)
Usage
<a href="#div-id" v-smooth-scroll>Anchor</a>
<div id="div-id"></div>
Custom options
Defaults
{
duration: 500, // Animation speed
offset: 0, // Offset from element, you can use positive or negative values
}
Example:
<a href="#div-id" v-smooth-scroll="{ duration: 1000, offset: -50 }">Anchor</a>
<div id="div-id"></div>
Without Browserify or Webpack
<body>
<div id="app">
<a href="#app" v-smooth-scroll>Anchor</a>
</div>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue-smooth-scroll@1.0.11"></script>
<script>
Vue.use(VueSmoothScroll)
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
</script>
</body>
Version History
| Version | Released | License |
|---|---|---|
| 1.0.13 | MIT | |
| 1.0.12 | MIT | |
| 1.0.11 | MIT | |
| 1.0.10 | MIT | |
| 1.0.9 | MIT | |
| 1.0.8 | MIT | |
| 1.0.7 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT |