Teleport is by far one of my favorite additions to Vue 3. It is not specifically a Composition API feature. It means that we can use it even with the…
How to use nextTick() in Composition API in Vue.js | Example
nextTick allows us to wait untill the DOM has updated and then do something. In the Options API, we could access the nextTick through the global option this.$nextTick. However, this…
Remove polygons on click in Google Maps JavaScript API | Vue.js | Example
Earlier we've seen how we can create polygons with labels, create editable polygons, and highlight polygons on hover in Google Maps JavaScript API v3 using Vue.js. Today we'll see how…
How to use ref in Composition API in Vue 3 | Example
Refs work a bit differently in Composition API as compared to the Options API. In the Options API, we could declare any element with a ref like this: <h1 ref="titleRef">…
How to use a global directive in Vue 3 Composition API | Example
Earlier I had written an article on how we can create and use custom directives in Options API in Vue.js. In this article, we'll see how we can define and…
How to create routes in Composition API in Vue.js | Example
The way routes and routers work haven't really changed much in Composition API. The changes are subtle and we can easily adapt to the new routing system. Here's an example…
How to add a custom loader in Vue.js | Example
Loaders and progress bars are probably some of the most important components of any web application. Creating and showing a loader while some content is being loaded is pretty easy…
How to use onUpdated in Composition API in Vue.js | Example
You can use the onUpdated lifecycle hook in Vue.js whenever there's been a re-render of the component. A re-render occurs whenever you make some changes to the reactive data you've…
How to use mounted() lifecycle hook in Composition API in Vue.js | Example
Composition API completely revamped the Options API with several improvements and changes. While these changes don't affect the template scope much, we certainly have a lot to deal with what…