(def: InnerComponentDef)
| 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 |
no test coverage detected