Category · 59 articles

Script

Articles in the category Script.

Vue Tip: Use VueUse to Unleash the Power of Utility Functions Image

Vue Tip: Use VueUse to Unleash the Power of Utility Functions

VueUse is a collection of hundreds of essential Vue Composition Utilities for interacting with various browsers, sensors, animations, and state APIs, and more.
Vue Tip: Emit Event From Composable Image

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 Tip: Split Your SFC into Multiple Files Image

Vue Tip: Split Your SFC into Multiple Files

Use the 'src' attribute to import an external file for a language block in your Vue Single-File Components (SFC).
Vue Tip: Use Eager Computed Without Lazy Evaluation Image

Vue Tip: Use Eager Computed Without Lazy Evaluation

Computed properties are evaluated lazily which means they are only evaluated when they are accessed. The computedEager() from VueUse is a good alternative for simple operations.
Vue Tip: Debug Watcher Image

Vue Tip: Debug Watcher

You can debug watchers by passing a third options object with onTrack and onTrigger callbacks.
Vue Tip: Effortless Handle Asynchronous Components With Suspense Image

Vue Tip: Effortless Handle Asynchronous Components With Suspense

Suspense components are used to display fallback content when waiting for some sort of asynchronous component to resolve.
Vue Tip: Declare and Mutate v-model Props as Normal Variable Using defineModel Image

Vue Tip: Declare and Mutate v-model Props as Normal Variable Using defineModel

Declaring and mutate v-model props as the same as normal variable using the defineModel.
Vue Tip: Optimize Performance Using shallowRef Image

Vue Tip: Optimize Performance Using shallowRef

shallowRef() is typically used for performance optimizations of large data structures, or integration with external state management systems.
Vue Tip: Validate Events and Prop Types Image

Vue Tip: Validate Events and Prop Types

You can validate prop types and events in Vue. If a requirement is not met, Vue will warn you in the browser's JavaScript console.
Vue Tip: When to Use Render Function Image

Vue Tip: When to Use Render Function

When should I use a render function in Vue.js? We’re going to cover some advanced Vue.js patterns when you need to use render functions.