File tree 7 files changed +55
-0
lines changed
packages/@lwc/engine-server/src/__tests__/fixtures/slots-light-evil-template-as-prop
7 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "entry" : " x/outer"
3
+ }
Original file line number Diff line number Diff line change
1
+ < fixture-test >
2
+ < x-inner >
3
+ a
4
+ <!---->
5
+ slotted content
6
+ <!---->
7
+ b
8
+ <!---->
9
+ < div >
10
+ named slotted content
11
+ </ div >
12
+ <!---->
13
+ c
14
+ </ x-inner >
15
+ </ fixture-test >
Original file line number Diff line number Diff line change
1
+ import { LightningElement , api } from 'lwc' ;
2
+
3
+ export default class extends LightningElement {
4
+ static renderMode = 'light' ;
5
+ @api tmpl ;
6
+
7
+ render ( ) {
8
+ return this . tmpl ;
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ < template lwc:render-mode ="light ">
2
+ a
3
+ < slot > fallback for default</ slot >
4
+ b
5
+ < slot name =foo > fallback for foo</ slot >
6
+ c
7
+ </ template >
Original file line number Diff line number Diff line change
1
+ < template lwc:render-mode ="light ">
2
+ < x-inner tmpl ={innerTemplateFn} >
3
+ slotted content
4
+ < div slot ="foo "> named slotted content</ div >
5
+ </ x-inner >
6
+ </ template >
Original file line number Diff line number Diff line change
1
+ import { LightningElement } from 'lwc' ;
2
+ import innerTemplateFn from './innerTemplateFn.html' ;
3
+ import tmpl from './outer.html' ;
4
+
5
+ export default class extends LightningElement {
6
+ static renderMode = 'light' ;
7
+ innerTemplateFn = innerTemplateFn ;
8
+
9
+ // This isn't strictly necessary and has no functional value relative to an implicit template. It is present
10
+ // only to disambiguate the outer component's template from the one we're passing to the child.
11
+ render ( ) {
12
+ return tmpl ;
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments