svelte-webcomponent-boilerplate icon indicating copy to clipboard operation
svelte-webcomponent-boilerplate copied to clipboard

[BUG] Cannot export variabiles of webcomponents attributes with kebab-case syntax

Open ptkdev opened this issue 4 years ago • 3 comments

Svelte refs:

#3852 #875

Example

HTML:

<my-component header-text="hello"></my-component>

Svelte file:

<svelte:options tag="my-component" />
<script>
	export let headerText;
</script>

<div>
{headerText}
</div>

<style lang="scss">
</style>

headerText is undefined.

Workaround:

You can use {$$props["header-text"]} but if user change the html attribute, svelte, don't re-render html and webcomponent show always "hello".

ptkdev avatar Apr 08 '21 17:04 ptkdev

Why my result still undefined by $$props ?

veeking avatar Oct 12 '21 09:10 veeking

I have the same problem, please fix this as soon as possible

abdolian avatar Oct 12 '21 18:10 abdolian

@veeking @abdolian This is svelte issue https://github.com/sveltejs/svelte/issues/3852

ptkdev avatar Oct 12 '21 18:10 ptkdev