Learn how a Vue application is born and mounted to the DOM.
1The App Instance
Every Vue application begins by creating an app instance with createApp. This instance serves as an isolated environment where you can register global state, routers, and plugins without affecting other Vue apps on the same page.
2The Mount Method
An app instance doesn't render anything until its .mount() method is called. It expects a CSS selector (like #app) or an actual DOM element. Vue will take control of that element's inner HTML.
3<script setup>
<script setup> is a compile-time syntactic sugar for using the Composition API. Variables and imports defined inside this block are directly usable in the template, drastically reducing boilerplate code.
