Skip to content

Commit 1a8027a

Browse files
committed
wip: save
1 parent 9f6a1b1 commit 1a8027a

File tree

5 files changed

+2002
-45
lines changed

5 files changed

+2002
-45
lines changed

packages/runtime-dom/src/apiCustomElement.ts

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ export abstract class VueElementBase<
322322
}
323323
}
324324

325+
get _isVapor(): boolean {
326+
return `__vapor` in this._def
327+
}
328+
325329
protected _setParent(
326330
parent: VueElementBase | undefined = this._parent,
327331
): void {
@@ -455,7 +459,22 @@ export abstract class VueElementBase<
455459
}
456460
}
457461

458-
protected _processEmit(): void {
462+
protected _processInstance(): void {
463+
this._instance!.ce = this
464+
this._instance!.isCE = true
465+
466+
if (__DEV__) {
467+
this._instance!.ceReload = newStyles => {
468+
if (this._styles) {
469+
this._styles.forEach(s => this._root.removeChild(s))
470+
this._styles.length = 0
471+
}
472+
this._applyStyles(newStyles)
473+
this._instance = null
474+
this._update()
475+
}
476+
}
477+
459478
const dispatch = (event: string, args: any[]) => {
460479
this.dispatchEvent(
461480
new CustomEvent(
@@ -530,7 +549,7 @@ export abstract class VueElementBase<
530549
if (val === REMOVAL) {
531550
delete this._props[key]
532551
} else {
533-
this._props[key] = val
552+
this._props[key] = this._isVapor ? () => val : val
534553
// support set key on ceVNode
535554
if (key === 'key' && this._app && this._app._ceVNode) {
536555
this._app._ceVNode!.key = val
@@ -746,21 +765,7 @@ export class VueElement extends VueElementBase<
746765
if (!this._instance) {
747766
vnode.ce = instance => {
748767
this._instance = instance
749-
instance.ce = this
750-
instance.isCE = true
751-
if (__DEV__) {
752-
instance.ceReload = newStyles => {
753-
if (this._styles) {
754-
this._styles.forEach(s => this._root.removeChild(s))
755-
this._styles.length = 0
756-
}
757-
this._applyStyles(newStyles)
758-
this._instance = null
759-
this._update()
760-
}
761-
}
762-
763-
this._processEmit()
768+
this._processInstance()
764769
this._setParent()
765770
}
766771
}

0 commit comments

Comments
 (0)