I have some issues in my Vue Code I want to create a ScrollToTop Button in Vue but I get this Error message in console:
Uncaught ReferenceError: $ is not defined
My Code :
export default {
data() {
return {
isExample: false,
}
}
},
mounted() {
window.addEventListener('scroll', this.handleScroll);
},
methods: {
handleScroll() {
if (window.scrollY > 120) {
this.isExample = true,
$('.example-1').addClass("is-close"),
} else if (window.scrollY < 120) {
this.isExample = false,
$('.example-1').removeClass("is-close")
}
}
}
}