mirror of https://github.com/sveltejs/svelte
inject lets for destructured reactive declarations - fixes #2396
parent
b36d24032b
commit
d7b32fb22c
@ -0,0 +1,16 @@
|
||||
export default {
|
||||
props: {
|
||||
coords: [0, 0]
|
||||
},
|
||||
|
||||
html: `
|
||||
<p>0,0</p>
|
||||
`,
|
||||
|
||||
test({ assert, component, target }) {
|
||||
component.coords = [1, 2];
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>1,2</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
export let coords;
|
||||
|
||||
$: [x, y] = coords;
|
||||
</script>
|
||||
|
||||
<p>{x},{y}</p>
|
Loading…
Reference in new issue