Vue · Junior · Question 4 of 75

How is a Vue application created and attached to the page?

import { createApp } from "vue";
import App from "./App.vue";

createApp(App).mount("#app");

Explanation

Plugins are registered on the app instance before mounting: createApp(App).use(router).use(createPinia()).mount('#app'). new Vue() was the Vue 2 API.

Further reading

Problem with a question

Vue · Junior · question 4

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz