app.mount =(containerOrSelector: Element | ShadowRoot |string):any=>{const container =normalizeContainer(containerOrSelector)if(!container)returnconst component = app._component
if(!isFunction(component)&&!component.render &&!component.template){// __UNSAFE__// Reason: potential execution of JS expressions in in-DOM template.// The user must make sure the in-DOM template is trusted. If it's// rendered by the server, the template should not contain any user data.
component.template = container.innerHTML
// 2.x compat check...}// clear content before mounting
container.innerHTML =''const proxy =mount(container,false, container instanceofSVGElement)if(container instanceofElement){
container.removeAttribute('v-cloak')
container.setAttribute('data-v-app','')}return proxy
}
mount(
rootContainer: HostElement,
isHydrate?:boolean,
isSVG?:boolean):any{if(!isMounted){// #5571...const vnode =createVNode(
rootComponent as ConcreteComponent,
rootProps
)// store app context on the root VNode.// this will be set on the root instance on initial mount.
vnode.appContext = context
// HMR root reloadif(__DEV__){
context.reload=()=>{render(cloneVNode(vnode), rootContainer, isSVG)}}if(isHydrate && hydrate){hydrate(vnode as VNode<Node, Element>, rootContainer asany)}else{render(vnode, rootContainer, isSVG)}
isMounted =true
app._container = rootContainer
// for devtools and telemetry;(rootContainer asany).__vue_app__ = app
if(__DEV__ || __FEATURE_PROD_DEVTOOLS__){
app._instance = vnode.component
devtoolsInitApp(app, version)}returngetExposeProxy(vnode.component!)|| vnode.component!.proxy
}elseif(__DEV__){warn(`App has already been mounted.\n`+`If you want to remount the same app, move your app creation logic `+`into a factory function and create fresh app instances for each `+`mount - e.g. \`const createMyApp = () => createApp(App)\``)}},