mirror of https://github.com/sveltejs/svelte
Merge pull request #2266 from sveltejs/gh-2264
allow reactive declarations to only depend on $$propspull/2269/head
commit
beeaa3d09b
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
let props;
|
||||
$: {
|
||||
let { foo, bar, baz, ...others } = $$props;
|
||||
props = others;
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>{props.qux}</p>
|
@ -0,0 +1,22 @@
|
||||
export default {
|
||||
show: 1,
|
||||
|
||||
props: {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
d: 4
|
||||
},
|
||||
|
||||
html: `
|
||||
<p>4</p>
|
||||
`,
|
||||
|
||||
test({ assert, component, target }) {
|
||||
component.d = 5;
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>5</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
import Nested from './Nested.svelte';
|
||||
|
||||
export let a;
|
||||
export let b;
|
||||
export let c;
|
||||
export let d;
|
||||
</script>
|
||||
|
||||
<Nested foo={a} bar={b} baz={c} qux={d}/>
|
Loading…
Reference in new issue