Kategorie · 8 Artikel

Composables

Artikel in der Kategorie Composables.

2024

1 Eintrag

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.

Vue-Tipp1 Min.ScriptComposables

2023

6 Einträge

Vue Tip: Use Your Composables Synchronously

You should always call your composables synchronously in setup() hook or <script setup>. Otherwise Vue will not be able to determine the current active component instance and cannot correctly register features like lifecycle hooks, watchers, and computed properties.

Vue-Tipp2 Min.ScriptComposables

Vue Tip: Emit Event From Composable

Your application may contain a lot of components that are using the same logic, like emitting the same event. In this case, it might be tempting to create a composable that will emit this event and is used in all components. But how do you emit an event from inside a composable?

Vue-Tipp2 Min.ScriptComposables

2022

1 Eintrag