Category

List of articles for category: "Script"
Vue Tip: Access DOM in Watcher Callback After Vue Updated It Image

Vue Tip: Access DOM in Watcher Callback After Vue Updated It

To access the DOM after Vue has updated it in a watcher callback, you can use the flush post option.
Vue Tip: Accessing Template Ref in Child Component Image

Vue Tip: Accessing Template Ref in Child Component

Learn how to access template refs in a child component within a Vue.
Vue Tip: Assign Handler for Uncaught Errors Image

Vue Tip: Assign Handler for Uncaught Errors

Error monitoring is important in production, and we can use the errorHandler function to send errors to error tracking services.
Vue Tip: Automatic Global Registration of Base Components Image

Vue Tip: Automatic Global Registration of Base Components

We can use webpack to register our Vue.
Vue Tip: Automatically Import Components Image

Vue Tip: Automatically Import Components

Use the unplugin-vue-components tool to automatically import your Vue components.
Vue Tip: Avoid Directly DOM Manipulation Image

Vue Tip: Avoid Directly DOM Manipulation

It is a no-go to manipulate the DOM in Vue.
Vue Tip: Avoid Mutating a Prop Directly Image

Vue Tip: Avoid Mutating a Prop Directly

Mutating props is an anti-pattern.
Vue Tip: Avoid Side Effects in Computed Properties Image

Vue Tip: Avoid Side Effects in Computed Properties

It is considered bad practice to introduce side effects inside computed properties and functions because it makes the code unpredictable and hard to understand.
Vue Tip: Best Way to Force Re-Render Vue Component Image

Vue Tip: Best Way to Force Re-Render Vue Component

In certain scenarios, Vue's reactivity approach isn’t sufficient, and we need to force re-rendering of specific components.
Vue Tip: Check if Component Has Event Listener Attached Image

Vue Tip: Check if Component Has Event Listener Attached

Sometimes, you want to apply specific styles to a component only if it has an event listener attached.