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.

#36

Vue Tip: Avoid Empty Wrapper for Conditions

There are many situations when you need to conditionally display multiple Vue components. To avoid "empty" wrappers you should use not use HTML tags.

1 Min.Template
#35

Vue Tip: Delay Loading Appearance of Spinner

Eager delay spinners are not a good user experience. They can make a snappy user interface feel slower. We want delay spinners to appear only after a perceivable delay.

1 Min.Template
#31

Vue Tip: Use Fallthrough Attributes

A 'fallthrough attribute' is an attribute or v-on event listener that is passed to a component, but is not explicitly declared in the receiving component's props or emits. Common examples of this include class, style, and id attributes.

2 Min.Template
#23

Vue Tip: Animate Child Component Before Route Leave

Vue Router provides a way to use transitions on route components and animate the navigations. But sometimes, you might want to animate a specific (sub-)component before a route is left.

1 Min.Router
#17

Vue Tip: Use Two Script Blocks

<script setup> can be used alongside normal <script>. A normal <script> may be needed in special cases.

1 Min.Script
#14

Vue Tip: Display Raw HTML

The double mustaches interpret the data as plain text, not HTML. To output real HTML, you will need to use the v-html directive.

1 Min.Template
Seite 5 von 6