API Styles

Last updated

What is API Styles?

Though Vue 2 supported many approaches to writing components, only one approach, the "Options API", was built in and accessible without plugins. Vue 3, retains the Options API (OAPI), and adds in the Composition API (CAPI). Composition API itself is actually a part of the Options API, but moves most of the component logic into a setup function. This led to a 3rd approach to writing components being built in called "script/setup", which removes much of the boilerplate from Composition API. These approaches are not mutually exclusive. Each component in your project can use any of these approaches, however for consistency it is recommended to stick primarily to one, and only deviate to one of the others when you have a good reason.

Free resources to learn API Styles

More in stage 4: API Styles

API Styles: common questions

Can I learn API Styles in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain API Styles in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this API Styles tutorial for beginners?

It is lesson 14 of 84 in the free Vue roadmap, in stage 4, API Styles. If you are new to Vue, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me