mirror of https://github.com/sveltejs/svelte
parent
0c15a7f98e
commit
4fd6d29227
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: assign correct scope to attributes of named slot
|
@ -0,0 +1,7 @@
|
||||
<script lang="ts">
|
||||
export let onclick;
|
||||
</script>
|
||||
|
||||
<button {onclick}>
|
||||
<slot />
|
||||
</button>
|
@ -0,0 +1 @@
|
||||
<slot name="item" item={1} />
|
@ -0,0 +1,12 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
test({ assert, logs, target }) {
|
||||
const btn = target.querySelector('button');
|
||||
|
||||
btn?.click();
|
||||
flushSync();
|
||||
assert.deepEqual(logs, [1]);
|
||||
}
|
||||
});
|
@ -0,0 +1,8 @@
|
||||
<script lang="ts">
|
||||
import Parent from './Parent.svelte';
|
||||
import Child from './Child.svelte';
|
||||
</script>
|
||||
|
||||
<Parent>
|
||||
<Child slot="item" let:item onclick={() => console.log(item)}>asd</Child>
|
||||
</Parent>
|
Loading…
Reference in new issue