You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to access the properties of the host component within a slot of another component. According to HTML behavior, slotted content belongs to the context of the host component. Properties should therefore also be available within slotted content.
<!-- components/c-faq.webc --><c-section:@title="title"><detailswebc:for="question of questions"><summary@text="question.question"></summary><p@text="question.answer"></p></details></c-section>
// index.jsimport{WebC}from"@11ty/webc";constpage=newWebC();page.setBundlerMode(true);page.setInputPath("index.webc");page.defineComponents("components/*.webc");const{ html }=awaitpage.compile();console.log(html);
It is not possible to access the properties of the host component within a slot of another component. According to HTML behavior, slotted content belongs to the context of the host component. Properties should therefore also be available within slotted content.
version: 0.11.4
maybe related: Issue 205
Example
Related Files
Expected Behavior
The Example should compile to:
Actual Behavior
The example compiles to:
Workaround
If we pass
:@questions="questions
to the component, we can achieve the expected result.The text was updated successfully, but these errors were encountered: