Commit f48ed25e authored by christianrhansen's avatar christianrhansen

setting up an observer has some requirements now

parent 7b0ab1b8
......@@ -7,9 +7,11 @@
export default {
props: ['element'],
mounted () {
let observer = new IntersectionObserver(this.observerCallback)
observer.observe(this.$refs.targetHandler)
this.observer = observer
if (this.element) {
let observer = new IntersectionObserver(this.observerCallback)
observer.observe(this.$refs.targetHandler)
this.observer = observer
}
},
methods: {
observerCallback (entries) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment