mirror of https://github.com/sveltejs/svelte
parent
6acf7f3fc3
commit
92408e1506
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: take into account setters when spreading and binding
|
@ -0,0 +1,21 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<button class="foo">0</button><button class="foo">0</button>`,
|
||||
|
||||
async test({ assert, target }) {
|
||||
const [btn1, btn2] = target.querySelectorAll('button');
|
||||
|
||||
await btn1?.click();
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`<button class="foo">1</button><button class="foo">1</button>`
|
||||
);
|
||||
|
||||
await btn2?.click();
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`<button class="foo">2</button><button class="foo">2</button>`
|
||||
);
|
||||
}
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
let { value, ...props } = $props();
|
||||
|
||||
</script>
|
||||
|
||||
<button {...props} onclick={() => value++}>{value}</button>
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import Button from './button.svelte';
|
||||
|
||||
let value = $state(0);
|
||||
|
||||
const props = {
|
||||
class: 'foo'
|
||||
};
|
||||
</script>
|
||||
|
||||
<Button {...props} bind:value />
|
||||
<button {...props} onclick={() => value++}>{value}</button>
|
Loading…
Reference in new issue