Skip to content

Commit

Permalink
test(engine-server): test scoped slot forwarding (#4669)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Oct 21, 2024
1 parent 02e434e commit 5391bc3
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<x-light-container>
<x-scoped-slot-parent>
<x-scoped-slot-child>
<x-leaf>
<template shadowrootmode="open">
<slot>
</slot>
<slot name="foo">
</slot>
</template>
<h2>
Hello world!
</h2>
</x-leaf>
</x-scoped-slot-child>
</x-scoped-slot-parent>
</x-light-container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const tagName = 'x-light-container';
export { default } from 'x/lightContainer';
export * from 'x/lightContainer';
export const features = [];
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<slot></slot>
<slot name="foo"></slot>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template lwc:render-mode="light">
<x-scoped-slot-parent></x-scoped-slot-parent>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {
static renderMode = 'light';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template lwc:render-mode="light">
<x-leaf>
<!-- Note the slot mapping does not work for scoped slots -->
<slot lwc:slot-bind={title} slot="foo"></slot>
</x-leaf>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {
static renderMode = 'light';

title = 'Hello world!';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template lwc:render-mode="light">
<x-scoped-slot-child>
<template lwc:slot-data="title">
<h2>{title}</h2>
</template>
</x-scoped-slot-child>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement } from 'lwc';

export default class extends LightningElement {
static renderMode = 'light';
}

0 comments on commit 5391bc3

Please sign in to comment.