Search⌘ K
AI Features

App Initialization

Explore how to initialize Vue 3 applications using the createApp method, discovering the benefits of isolated Vue contexts. Understand differences from Vue 2, especially how plugins and global properties are managed distinctly in multiple Vue app instances.

We'll cover the following...

Another change in the latest version of Vue is how a Vue application is initialized. Previously, new Vue() was used to create a new Vue application instance. However, it was impossible to create separate Vue applications in Vue 2 because they shared the same Vue context. Vue 3 doesn’t have a default export anymore, so a Vue application must be created using the createApp method. The createApp returns a new application instance, which provides an isolated Vue context.

Note: References to Vue applications in this section, it doesn’t mean two separate Vue projects but, rather, one project with two Vue application instances that were created using the createApp method.

Vue 2 and Vue 3

See how ...