Passing some props from one component to another hasn't really changed in the Composition API. However, the way how we receive the props has changed. Consider the following example where…
How to import child components in Composition API in Vue 3 | Example
With the Composition API in Vue 3, importing and using child components has become much more easier than before. Consider an example where we have two components named ParentComponent.vue and…
How to use teleport in Vue.js 3 | Modal | Example
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…