Vue tips · 132 tips

Vue & Nuxt tips

Over the last few years, I've collected a list of valuable tips while developing and writing about Vue & Nuxt. Some are clever, some I use almost every day, and some are more advanced — but they're all useful.

Nuxt Tip: Difference Between useFetch and event.$fetch Image

Nuxt Tip: Difference Between useFetch and event.$fetch

Understand the key distinction between useFetch and event.$fetch in Nuxt. Learn why using event.$fetch for server-side API calls is the recommended approach for better performance and SSR correctness.
Vue Tip: Infer Props From Components in a Component Map Image

Vue Tip: Infer Props From Components in a Component Map

Use a typed entry helper to infer props from each component in a component map. This is useful when rendering dynamic blocks from CMS or configuration data.
Nuxt Tip: Accessing Pinia Store in Production Build Image

Nuxt Tip: Accessing Pinia Store in Production Build

A concise guide on how to access your Pinia store within a Nuxt production build.
Nuxt Tip: Managing Page Load States With useLoadingIndicator Image

Nuxt Tip: Managing Page Load States With useLoadingIndicator

Learn how to use the useLoadingIndicator composable in Nuxt to access and manage the loading state of your app's pages. Improve user experience by displaying loading indicators and handling transitions seamlessly.
Vue Tip: Use effectScope for Managing and Cleaning Up Reactive Effects Image

Vue Tip: Use effectScope for Managing and Cleaning Up Reactive Effects

effectScope can be used to group and cleanup multiple reactive effects.
Nuxt Tip: Parallel Fetch Requests Image

Nuxt Tip: Parallel Fetch Requests

Learn to wield useAsyncData along with Promise.all() to load data faster with parallel requests in your Nuxt application.
Nuxt Tip: Fetch Data on the Server Before App Start Image

Nuxt Tip: Fetch Data on the Server Before App Start

Learn how to pre-fetch data on the server before app start in Nuxt 3+ to improve load times and user experience.
Nuxt Tip: Validate Data in Your Server Routes Image

Nuxt Tip: Validate Data in Your Server Routes

Ensure that your data are valid and safe in your Nuxt server routes before processing them.
Vue Tip: Simple Routing Without Using External Libraries Image

Vue Tip: Simple Routing Without Using External Libraries

If you want to keep things simple and avoid adding extra dependencies, you can implement basic routing functionality in Vue.js without using external libraries like Vue Router.
Vue Tip: Cache Component Instances With the KeepAlive Component Image

Vue Tip: Cache Component Instances With the KeepAlive Component

KeepAlive is a built-in Vue component that allows you to conditionally cache component instances when dynamically switching between multiple components.