[IMP] portal: compile t-portal in an internal Component Portal

This commit also clean-up the deepRemove for the Portal that is not
needed any more.
This commit is contained in:
Jorge Pinna Puissant
2022-01-17 15:40:43 +01:00
committed by Aaron Bohy
parent 42a140a8e3
commit 41ad5db2e3
11 changed files with 496 additions and 240 deletions
+4 -6
View File
@@ -15,11 +15,9 @@ export class VMulti {
anchors?: Node[] | undefined;
parentEl?: HTMLElement | undefined;
isOnlyChild?: boolean | undefined;
deepRemove: boolean;
constructor(children: (VNode | undefined)[], deepRemove: boolean) {
constructor(children: (VNode | undefined)[]) {
this.children = children;
this.deepRemove = deepRemove;
}
mount(parent: HTMLElement, afterNode: Node | null) {
@@ -105,7 +103,7 @@ export class VMulti {
remove() {
const parentEl = this.parentEl;
if (this.isOnlyChild && !this.deepRemove) {
if (this.isOnlyChild) {
nodeSetTextContent.call(parentEl, "");
} else {
const children = this.children;
@@ -131,6 +129,6 @@ export class VMulti {
}
}
export function multi(children: (VNode | undefined)[], deepRemove = false): VNode<VMulti> {
return new VMulti(children, deepRemove);
export function multi(children: (VNode | undefined)[]): VNode<VMulti> {
return new VMulti(children);
}