Category · 59 articles

Script

Articles in the category Script.

2026

1 entry

2025

1 entry

2024

7 entries

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 tip1 minScriptComposables

Vue Tip: Watch Slot Changes

You can use the MutationObserver API to react to changes in the slot content.

Vue tip1 minTemplateScript

2023

11 entries

Vue Tip: Use a Head Manager

Unhead is a framework-agnostic document head manager that can be used to manage page metadata like the title in your Vue application.

Vue tip1 minScript

Vue Tip: Accessing Template Ref in Child Component

Learn how to access template refs in a child component within a Vue.js application, enabling you to manipulate and interact with specific elements in the child component's template from the parent component.

Vue tip1 minTemplateScript

Vue Tip: Event Handling

There are different ways how to handle events in Vue. Let's take a look at them.

Vue tip1 minTemplateScript

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 tip2 minScriptComposables

Vue Tip: Deep Watch on Arrays

In Vue 3, when using the watch option to watch an array, the callback will only trigger when the array is replaced. To trigger the watcher on mutation, the deep option must be specified.

Vue tip1 minScript

Vue Tip: Manually Stop Watcher

You need to manually stop your Vue watcher if they are created asynchronously. Sync watchers are automatically stopped when the component is unmounted.

Vue tip1 minScript
Page 1 of 3