Skip to content

Commit d66b951

Browse files
committed
Improve component slots info
1 parent 80c955a commit d66b951

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

Writerside/topics/webview/web-components-api.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,20 @@ class MyExampleComponent implements HasShadowDomInterface
9696
{
9797
public function render(): string
9898
{
99-
//
100-
// Please note that using the short "<slot />" version
101-
// instead of full "<slot></slot>" may not work correctly.
102-
//
10399
return '<b>This is <slot></slot>!!!</b>';
104100
}
105101
}
106102
```
107103

104+
<warning>
105+
Slot tags (<code>&lt;slot /&gt;</code>) only work in Shadow DOM
106+
</warning>
107+
108+
<warning>
109+
Using the short <code>&lt;slot /&gt;</code> version instead of
110+
full <code>&lt;slot&gt;&lt;/slot&gt;</code> may not work correctly
111+
</warning>
112+
108113
If you try to render the contents of a `<slot />` without a Shadow DOM (using
109114
`HasTemplateInterface`), no data will be received.
110115

0 commit comments

Comments
 (0)