MCPcopy
hub / github.com/vuejs/core / _mount

Method _mount

packages/runtime-dom/src/apiCustomElement.ts:436–464  ·  view source on GitHub ↗
(def: InnerComponentDef)

Source from the content-addressed store, hash-verified

434 }
435
436 private _mount(def: InnerComponentDef) {
437 if ((__DEV__ || __FEATURE_PROD_DEVTOOLS__) && !def.name) {
438 // @ts-expect-error
439 def.name = 'VueElement'
440 }
441 this._app = this._createApp(def)
442 // inherit before configureApp to detect context overwrites
443 this._inheritParentContext()
444 if (def.configureApp) {
445 def.configureApp(this._app)
446 }
447 this._app._ceVNode = this._createVNode()
448 this._app.mount(this._root)
449
450 // apply expose after mount
451 const exposed = this._instance && this._instance.exposed
452 if (!exposed) return
453 for (const key in exposed) {
454 if (!hasOwn(this, key)) {
455 // exposed properties are readonly
456 Object.defineProperty(this, key, {
457 // unwrap ref to be consistent with public instance behavior
458 get: () => unref(exposed[key]),
459 })
460 } else if (__DEV__) {
461 warn(`Exposed property "${key}" already exists on custom element.`)
462 }
463 }
464 }
465
466 private _resolveProps(def: InnerComponentDef) {
467 const { props } = def

Callers 2

connectedCallbackMethod · 0.95
resolveMethod · 0.95

Calls 6

_inheritParentContextMethod · 0.95
_createVNodeMethod · 0.95
hasOwnFunction · 0.90
warnFunction · 0.90
unrefFunction · 0.85
mountMethod · 0.80

Tested by

no test coverage detected