mirror of https://github.com/sveltejs/svelte
parent
eedb59355f
commit
4285e6d814
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: prevent snippet children conflict
|
@ -0,0 +1,10 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'conflicting-children-snippet',
|
||||||
|
message:
|
||||||
|
'Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block',
|
||||||
|
position: [320, 353]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,25 @@
|
|||||||
|
<!-- ok -->
|
||||||
|
<Button>
|
||||||
|
hello
|
||||||
|
</Button>
|
||||||
|
<Button>
|
||||||
|
{#snippet children()}hi{/snippet}
|
||||||
|
</Button>
|
||||||
|
<Button>
|
||||||
|
hello
|
||||||
|
{#snippet foo()}x{/snippet}
|
||||||
|
</Button>
|
||||||
|
<Button>
|
||||||
|
{#snippet children()}hi{/snippet}
|
||||||
|
{#snippet foo()}x{/snippet}
|
||||||
|
</Button>
|
||||||
|
<div>
|
||||||
|
hello
|
||||||
|
{#snippet children()}hi{/snippet}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- invalid -->
|
||||||
|
<Button>
|
||||||
|
hello
|
||||||
|
{#snippet children()}hi{/snippet}
|
||||||
|
</Button>
|
Loading…
Reference in new issue