While I have a love for Vue.js 2, there are some limitations on how reusable components are and how the code has to be laid out. This has been both a blessing a curse. On the one hand, for simple components, it makes learning Vue super easy and a low barrier to entry. On the other hand, as components get more complicated, you find that code for different features in the same component is munged (is that a word?).

Vuejs 3 has overcome this limitation with the composition API. In this article, I will demonstrate these limitations in Vuejs 2 and show you the optional new approach for using the composition API.

As hinted at above, you are not forced to use the composition API it’s optional. For smaller components, just keep doing things the way you always did. As your components get more complex, perhaps having more than one feature, the composition API is really useful.

All the code on GitHub

I have developed a simple blog application, with two branches. One branch uses the Vue 2 options API and the other the Vue 3 Composition API

https://github.com/simonjcarr/vue3_composition_api

#composition-api #tutorial #vuejs #vuejs-3 #javascript #api

Developing a Full App Using The Vue 3 Composition API
6.70 GEEK