I have a simple web component written in plain Javascript. Its use:
<layer-list>
<item color="#0069C6">Layer 1</item>
<item color="#EF4627">Layer 2</item>
<item color="#8F17A0">Layer 3</item>
</layer-list>
It'd manipulate its content, the items, from the constructor. It works on a plain HTML page. However placing it in a .svelte file breaks it. The Svelte compiler dissects the <item>s from the component. At the time the web component constructor (or the connectedCallback) runs it's an empty <layer-list>. Items are put back later as the bundle.js reconstructs the page.
Can I delay the construction of the web component?
Is it possible to use the component like this:
<layer-list>
{#each layers as l}
<item color="{l.color}">{l.name}</item>
{/each}
</layer-list>
Thanks.