Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

Vue 3 Composition API

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

Vue Composition API Setup Method

In this lesson, we learn the basics of using the Vue Composition API setup method. setup is executed before the component is created, once the props are resolved, and serves as the entry point for composition APIs.

In order to expose things from the setup method and to the other component options (data, methods, computed, etc) as well as to the template, we need to return them from the setup method.