Photo by WrongTog on Unsplash

Lazy Load Components in Vue with defineAsyncComponent

Using Vue 3’s defineAsyncComponent feature lets us lazy load components — meaning they’re only loaded when they’re needed.

Matt Maribojoc
6 min readJun 28, 2021

--

Using Vue 3’s defineAsyncComponent feature lets us lazy load components. This means that they're only loaded from the server when they're needed.

This is a great way to improve initial page loads as our app will be loaded in smaller chunks rather than having to load every single component when the page loads.

What is Lazy Loading | Lazy vs. Eager Loading | Imperva
Source: Imperva.com

In this tutorial, we’ll learn all about defineAsyncComponent and look at an example that defers the loading of a popup until it's required by our app.

Okay — let’s get into it.

What is defineAsyncComponent

--

--

Matt Maribojoc
Matt Maribojoc

No responses yet