Hi. Never had so many issues with vanilla library before. I can't set it up with Nut/SSR!!! Please help.
I tried multiple solutions, none is working. For example.
if (process.browser) {
require('waypoints/lib/noframework.waypoints.js')
require('waypoints/lib/shortcuts/inview.min.js')
}
let waypoint
let Waypoint
export default {
data () {
return {
waypointed: false
}
},
mounted () {
waypoint = new Waypoint.Inview({
element: document.querySelector('.waypoint'),
entered: (direction) => {
console.log(direction)
this.waypointed = true
},
exited: (direction) => {
console.log(direction)
this.waypointed = false
}
})
},
beforeDestroy () {
waypoint.destroy()
}
}
I have errors from webpack, from Nuxt, from eslint. Where's the solution?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1598">#c1598</a>)</em></sub></div>