I'm a web developer, graphic designer, type designer, musician, comicbook-geek, LEGO-collector, food lover … as well as husband and father, located just south of Copenhagen, Denmark.
That's probably because parts of the DOM gets re-written. You could try <img data-src="your-image" loading="lazy" />, and then set img.src = img.dataset.src, when the component has been mounted in Vue.
Mads I might have to, thanks! I've been using a combination of Intersection observers, and a plugin, Vue.LazyLoad to handle the late binding of images on my page. It's just disappointing to see native HTML not render like you'd expect to see, but that might be one of the sacrifices you give up when using a framework.
Paul. Since Im just starting out with JS frameworks, I started with Vue. It is growing in popularity, however, React and Angular are still kings at this time.
That's probably because parts of the DOM gets re-written. You could try
<img data-src="your-image" loading="lazy" />
, and then setimg.src = img.dataset.src
, when the component has been mounted in Vue.Looks like a mixture from both worlds (see above in the article). As a disclaimer: I haven't give Vue.js a try. Should I? 🤔
Mads I might have to, thanks! I've been using a combination of Intersection observers, and a plugin, Vue.LazyLoad to handle the late binding of images on my page. It's just disappointing to see native HTML not render like you'd expect to see, but that might be one of the sacrifices you give up when using a framework.
Paul. Since Im just starting out with JS frameworks, I started with Vue. It is growing in popularity, however, React and Angular are still kings at this time.
Luke. I am very familiar with React, Angular and even Ember. But I haven't had the chance to look into Vue.js yet.