matheusgrieger / vue-clazy-load

Component-based lazy (CLazy) load images in Vue.js 2
https://matheusgrieger.github.io/vue-clazy-load/
MIT License
104 stars 5 forks source link

Fail when using v-if directive #2

Closed oliveiracdz closed 6 years ago

oliveiracdz commented 6 years ago

Hi there!

This PR fixes the error when trying to use within a element with "v-if=false"

image

Thanks!

matheusgrieger commented 6 years ago

Great and thank you!

Just can you adjust your code to the style of the rest of the file? Like this:

if (!this.$refs.component) {
  return
}
oliveiracdz commented 6 years ago

Sure, Matheus! Here it is!

matheusgrieger commented 6 years ago

Thank you!