akulubala / vue-product-zoomer

Zoom Prodct Image, useful for e-shop website
http://www.yoohooworld.com/demo.html
MIT License
289 stars 69 forks source link

Adding next tick to handle the zoomer better #55

Closed smaharj1 closed 4 years ago

smaharj1 commented 4 years ago

The issue with window.load

The main issue is that everything inside window.load only runs if the Product Zoomer is there in the beginning. So, it causes issues like the ones mentioned in #54 . If the ProductZoomer is rendered later in some conditional way, it will create issues.

Solution

Added this.$nextTick instead. This will make sure the styles are added everytime the component is mounted.