Michael Hoffmann
Michael Hoffmann

@Mokkapps

6 Tweets 12 reads Aug 28, 2023
πŸ’‘ Nuxt Tip: Lazy Load Components in Nuxt 3
Learn how you can dynamically import components in Nuxt 3 only when they're needed.
@nuxt_js
🧡 πŸ‘‡πŸ»
@nuxt_js You can easily dynamically import (also known as lazy-loading) a component in Nuxt 3 by adding the Lazy prefix to the component name:
@nuxt_js Lazy loading can help to improve your JavaScript bundle size and thus your application's performance by only loading components when they are needed.
@nuxt_js You can use the Network tab in your browser's developer tools to verify that HelloWorld is only loaded after the button has been clicked:

Loading suggestions...