FrontendDeveloper.in

Vue.js question detail

What are the different API styles available?

The Vue components can be created in two different API styles

  1. Options API: The Options API uses component logic using an object of options such as data, props, computed, methods and life cycle methods etc. The properties will be accessible inside functions using component instance(i.e, this).

  2. Composition API: The Composition API uses component logic using imported API functions. The Single File Components(SFCs) requires setup attribute(<script setup>) to use imported variables and functions directly inside template section.

Back to all Vue.js questions
Get LinkedIn Premium at Rs 399