Vue-Tipps · 132 Tipps

Vue- & Nuxt-Tipps

In den letzten Jahren habe ich beim Entwickeln und Schreiben über Vue & Nuxt eine Liste wertvoller Tipps gesammelt. Einige sind clever, einige benutze ich fast jeden Tag, und einige sind fortgeschrittener - aber sie sind alle nützlich.

#132 · Neuester

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.

2 Min.Nuxt
#127

Nuxt Tip: Parallel Fetch Requests

Learn to wield useAsyncData along with Promise.all() to load data faster with parallel requests in your Nuxt application.

1 Min.Nuxt
#121

Nuxt Tip: Run Code Once During SSR or CSR

Since Nuxt 3.9 you can use the useOnce composable to run a given function or block of code once during server-side rendering or client-side navigation.

1 Min.Nuxt
#120

Vue Tip: How I Write Class & Style Bindings

Styling your components in Vue.js can be done in multiple ways. One of the most common ways is to use the class attribute, especially if you are using a CSS framework like Tailwind. In combination with v-bind you can dynamically assign classes to your components.

1 Min.Template
#119

Vue Tip: When You Should Use a Composable

Vue composables are a way to encapsulate logic in a reusable way in Vue 3. They are a great way to share logic between components, but I often see them used in places where they are not needed.

1 Min.Script
#116

Nuxt Tip: Use Environment-Specific Configurations

It sometimes happens that you need to have different configurations for different environments in your Nuxt.js application. Therefore, Nuxt provides fully typed, per-environment overrides for your Nuxt configuration.

1 Min.Nuxt
#110

Nuxt Tip: Cancel Fetch API Request

In Nuxt 3, you can use the `signal` parameter with the globally available `$fetch` helper to cancel an API request.

1 Min.Nuxt
Seite 1 von 6