Vue3 Api Createapp
# Vue3 `createApp()` Function
* * Vue3 Global API](#)
In Vue3, `createApp()` is a global function used to create a new Vue application instance.
`createApp()` is the entry point for a Vue application. All components, plugins, routes, etc., must be registered and configured through this instance.
With `createApp()`, you can easily create, configure, and manage a Vue application, and mount it to a DOM element on the page.
Unlike `new Vue()` in Vue2, Vue3 introduces `createApp()` to create application instances, making the Vue API more modular and flexible.
The function syntax is as follows:
function createApp(rootComponent: Component, rootProps?: object): App
The first parameter is the root component. The second parameter is optional and represents the props to be passed to the root component.
* * *
## Basic Usage of `createApp()`
To use `createApp()`, you first need to import it from the Vue library. Here is a simple example:
## Example
// From Vue Import the createApp function from the library
import{ createApp } from 'vue';
// Create a root component
const App ={
template: `
YouTip