In case I have multiple <slot />
s nested inside my Stencil component, I would need to give them names, and then reference them inside my HTML page when using that component. So, how do I do that?
Example:
render() {
return(
<div>
<button><slot name="one" /></button>
<select>
<option value="one"><slot name="two" /></option>
</select>
<p> <slot name="three" /></p>
</div>
)
}
And then when I am adding this component, how do I add content to each <slot />
?
I have tried what is explained here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
but it's not working!
I have tried the following in my HTML page:
<span slot="two">dfdf</span>
<slot name="two"><span>gdgdg</span></slot>
Neither work!