Vue.js question detail
What are the different API styles available?
The Vue components can be created in two different API styles
-
Options API: The Options API uses component logic using an object of options such as
data,props,computed,methodsand life cycle methods etc. The properties will be accessible inside functions using component instance(i.e,this). -
Composition API: The Composition API uses component logic using imported API functions. The Single File Components(SFCs) requires
setupattribute(<script setup>) to use imported variables and functions directly inside template section.