mirror of https://github.com/sveltejs/svelte
throw warning instead of error (#7834)
parent
adcaa3c050
commit
1e2a55c88e
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
compileOptions: {
|
||||||
|
dev: true
|
||||||
|
},
|
||||||
|
warnings: ['<svelte:element this="input"> is self-closing and cannot have content.']
|
||||||
|
};
|
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
const tags = [{ t: 'div', content: 'hello world' }, { t: 'input' }];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#each tags as tag}
|
||||||
|
{tag.t} <br />
|
||||||
|
<svelte:element this={tag.t}>
|
||||||
|
{#if tag.t !== 'input'}{tag.content}{/if}
|
||||||
|
</svelte:element>
|
||||||
|
{/each}
|
Loading…
Reference in new issue