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");- ✓Correct answer:
createApp(rootComponent)creates an app instance,.mount()renders it into a DOM element - 2
new Vue({ el: '#app' })is the only way in Vue 3 - 3Vue mounts automatically to the first
<div>on the page
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.