created () {
if (process.client) {
window.addEventListener('scroll', this.handleScroll);
}
},
methods: {
handleScroll () {
console.log(window.scrollY)
}
},
destroyed () {
if (process.client) {
window.removeEventListener('scroll', this.handleScroll);
}
Created
May 8, 2022 09:29
-
-
Save siumhossain/bca9bc24c292032e5b41db7529bfcd6c to your computer and use it in GitHub Desktop.
window scroll event in nuxt js
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment