Skip to content

Commit dd3d0d6

Browse files
committed
Further updates to sveltejs#3128 that works using examples contained within sveltejs#4402
1 parent 3898b05 commit dd3d0d6

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/compiler/compile/render_dom/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function dom(
2020
block.has_outro_method = true;
2121

2222
// prevent fragment being created twice (#1063)
23-
if (options.customElement) block.chunks.create.push(b`this.c = @noop;`);
23+
//neek if (options.customElement) block.chunks.create.push(b`this.c = @noop;`);
2424

2525
const body = [];
2626

@@ -453,7 +453,7 @@ export default function dom(
453453
@insert(options.target, this, options.anchor);
454454
}
455455
456-
this.$$.slotted = {};
456+
this.$$.slotted = options.slots || {};
457457
${(props.length > 0 || uses_props) && b`
458458
for (const key in options.props.$$slots) {
459459
this.$$.slotted[key] = options.props.$$slots[key][0]();

src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,15 @@ export default class InlineComponentWrapper extends Wrapper {
400400
);
401401
}
402402

403+
/*if (component.compile_options.customElement) {
404+
@insert(${parent_node || '#target'}, ${name}, ${parent_node ? 'null' : 'anchor'});
405+
}
406+
else {
407+
@mount_component(${name}, ${parent_node || '#target'}, ${parent_node ? 'null' : 'anchor'});
408+
}*/
403409
block.chunks.mount.push(b`
404410
if (component.compile_options.customElement) {
405-
block.chunks.mount.push(
406-
@insert(${parent_node || '#target'}, ${name}, ${parent_node ? 'null' : 'anchor'});
407-
)
411+
@insert(${parent_node || '#target'}, ${name}, ${parent_node ? 'null' : 'anchor'});
408412
}
409413
else if (${name}) {
410414
@mount_component(${name}, ${parent_node || '#target'}, ${parent_node ? 'null' : 'anchor'});

src/runtime/internal/Component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ if (typeof HTMLElement === 'function') {
176176
// @ts-ignore todo: improve typings
177177
//this.appendChild(this.$$.slotted[key]);
178178
this.$$.slotted[key].m(this, null);
179+
//this.appendChild(this.$$.slotted[key].m(this, null));
179180
}
180181
}
181182

0 commit comments

Comments
 (0)