mirror of https://github.com/sveltejs/svelte
propagate changes through slots with props (#4091)
parent
f9a9484e39
commit
2cd5c2934b
@ -0,0 +1 @@
|
|||||||
|
<slot/>
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
export let prop
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<slot value={prop} />
|
@ -0,0 +1,12 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
prop: 'a',
|
||||||
|
},
|
||||||
|
|
||||||
|
html: 'a',
|
||||||
|
|
||||||
|
test({ assert, component, target }) {
|
||||||
|
component.prop = 'b';
|
||||||
|
assert.htmlEqual( target.innerHTML, 'b' );
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
import Outer from './Outer.svelte'
|
||||||
|
import Inner from './Inner.svelte'
|
||||||
|
|
||||||
|
export let prop
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Outer {prop} let:value>
|
||||||
|
<Inner>{value}</Inner>
|
||||||
|
</Outer>
|
Loading…
Reference in new issue