Vue 3 is great, specially the composition API is an awesome new feature.
Migrating Vue 2 class based components to Vue 3 is not difficult, except for some small changes like changing @Component to @Options everything is staying the same.
After migrations of Vue 3 with class components, we were ready to add the composition API.
This was harder than we expected because official docs don’t provide example for this specific setup https://composition-api.vuejs.org/.
For easier migration, it would be easier to keep the class components. This is an example with a small module using the composition API.
Calling the “get” function in the Vue component can be done like this:.
All the logic for ‘artists’ is located in ‘user-artists.ts’ and easy accessible in the component template.