Composition Api Computed

Posted on  by admin
October 14, 2020.

Vue 1 and 2 both used the options API. If you have read any Vue tutorial in the last few years, you will be familiar with it (when you had the data() function, computed object with computed property functions, functions such as mounted(), unmounted() etc).

Vue 3 still fully supports the options API (and it is recommended to use for simple projects).

But it has introduced a new way of doing things called the composition API. (The new Vue composition API is quite similar to React hooks.). A simple example of using the Vue composition API looks like this:.

mkrieger1
14.2k