forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
propagate changes through slots with props (sveltejs#4091)
- Loading branch information
1 parent
78a7596
commit d7e5f1c
Showing
5 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<slot/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let prop | ||
</script> | ||
|
||
<slot value={prop} /> |
12 changes: 12 additions & 0 deletions
12
test/runtime/samples/component-slot-let-in-slot/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default { | ||
props: { | ||
prop: 'a', | ||
}, | ||
|
||
html: 'a', | ||
|
||
test({ assert, component, target }) { | ||
component.prop = 'b'; | ||
assert.htmlEqual( target.innerHTML, 'b' ); | ||
} | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/runtime/samples/component-slot-let-in-slot/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |