Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
vue2-smooth-scroll
Advanced tools
Simple vue smooth scroll extended from vue-smooth-scroll
duration
problem, now animation work good.# install dependency
npm install --save vue2-smooth-scroll
// import on your project (less then 1KB gziped)
import vueSmoothScroll from 'vue2-smooth-scroll'
Vue.use(vueSmoothScroll)
<a href="#div-id" v-smooth-scroll>Anchor</a>
<div id="div-id"></div>
const exampleElement = this.$refs.exampleElement || this.$el || document.getElementById(...)
this.$smoothScroll({
scrollTo: exampleElement,
hash: '#exampleHash' // only required if updateHistory is true
... // optional overrides for global config
})
{
duration: 500, // Animation speed
offset: 0, // Offset from element, you can use positive or negative values
container: '', // the scroll container, default is window,use document.querySelector to query the Element,
updateHistory: true //Push hash to history or not
}
<div id="container">
<a href="#div-id" v-smooth-scroll="{ duration: 1000, offset: -50, container: '#container', updateHistory: false }">Anchor</a>
<div id="div-id"></div>
</div>
<body>
<div id="app">
<a href="#bottom" v-smooth-scroll>click me will scroll to bottom!</a>
<div style="height: 2000px;"></div>
<span id="bottom">bottom</span>
</div>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue2-smooth-scroll"></script>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
</script>
</body>
FAQs
Simple vue smooth scroll
The npm package vue2-smooth-scroll receives a total of 5,198 weekly downloads. As such, vue2-smooth-scroll popularity was classified as popular.
We found that vue2-smooth-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.