File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
compiler/compile/render_dom Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,12 @@ export default function dom(
453
453
@insert(options.target, this, options.anchor);
454
454
}
455
455
456
+ this.$$.slotted = {};
456
457
${ ( props . length > 0 || uses_props ) && b `
458
+ for (const key in options.props.$$slots) {
459
+ this.$$.slotted[key] = options.props.$$slots[key][0]();
460
+ this.$$.slotted[key].c();
461
+ }
457
462
if (options.props) {
458
463
this.$set(options.props);
459
464
@flush();
Original file line number Diff line number Diff line change @@ -401,7 +401,12 @@ export default class InlineComponentWrapper extends Wrapper {
401
401
}
402
402
403
403
block . chunks . mount . push ( b `
404
- if (${ name } ) {
404
+ if (component.compile_options.customElement) {
405
+ block.chunks.mount.push(
406
+ @insert(${ parent_node || '#target' } , ${ name } , ${ parent_node ? 'null' : 'anchor' } );
407
+ )
408
+ }
409
+ else if (${ name } ) {
405
410
@mount_component(${ name } , ${ parent_node || '#target' } , ${ parent_node ? 'null' : 'anchor' } );
406
411
}
407
412
` ) ;
Original file line number Diff line number Diff line change @@ -174,7 +174,8 @@ if (typeof HTMLElement === 'function') {
174
174
// @ts -ignore todo: improve typings
175
175
for ( const key in this . $$ . slotted ) {
176
176
// @ts -ignore todo: improve typings
177
- this . appendChild ( this . $$ . slotted [ key ] ) ;
177
+ //this.appendChild(this.$$.slotted[key]);
178
+ this . $$ . slotted [ key ] . m ( this , null ) ;
178
179
}
179
180
}
180
181
@@ -183,6 +184,11 @@ if (typeof HTMLElement === 'function') {
183
184
}
184
185
185
186
$destroy ( ) {
187
+ // @ts -ignore todo: improve typings
188
+ for ( const key in this . $$ . slotted ) {
189
+ // @ts -ignore todo: improve typings
190
+ this . $$ . slotted [ key ] . d ( ) ;
191
+ }
186
192
destroy_component ( this , 1 ) ;
187
193
this . $destroy = noop ;
188
194
}
You can’t perform that action at this time.
0 commit comments