-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dynamic
bind:this
on components (#2333)
- Loading branch information
Showing
11 changed files
with
78 additions
and
8 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
1 change: 1 addition & 0 deletions
1
test/runtime/samples/binding-this-component-computed-key/Foo.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 @@ | ||
<div>foo</div> |
8 changes: 8 additions & 0 deletions
8
test/runtime/samples/binding-this-component-computed-key/_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,8 @@ | ||
export default { | ||
skip_if_ssr: true, | ||
|
||
html: ` | ||
<div>foo</div> | ||
<div>has foo: true</div> | ||
` | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/runtime/samples/binding-this-component-computed-key/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,9 @@ | ||
<script> | ||
import Foo from './Foo.svelte'; | ||
export let foo = {}; | ||
</script> | ||
|
||
<Foo bind:this={foo['computed']}/> | ||
<div> | ||
has foo: {!!foo.computed} | ||
</div> |
1 change: 1 addition & 0 deletions
1
test/runtime/samples/binding-this-component-each-block-value/Foo.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 @@ | ||
<div>foo</div> |
12 changes: 12 additions & 0 deletions
12
test/runtime/samples/binding-this-component-each-block-value/_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 { | ||
skip_if_ssr: true, | ||
|
||
html: ` | ||
<div>foo</div> | ||
<div>first has foo: true</div> | ||
<div>foo</div> | ||
<div>second has foo: true</div> | ||
<div>foo</div> | ||
<div>third has foo: true</div> | ||
` | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/runtime/samples/binding-this-component-each-block-value/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,11 @@ | ||
<script> | ||
import Foo from './Foo.svelte'; | ||
export let foo = {}; | ||
</script> | ||
|
||
{#each ["first", "second", "third"] as value} | ||
<Foo bind:this={foo[value]}/> | ||
<div> | ||
{value} has foo: {!!foo[value]} | ||
</div> | ||
{/each} |
1 change: 1 addition & 0 deletions
1
test/runtime/samples/binding-this-component-each-block/Foo.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 @@ | ||
<div>foo</div> |
12 changes: 12 additions & 0 deletions
12
test/runtime/samples/binding-this-component-each-block/_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 { | ||
skip_if_ssr: true, | ||
|
||
html: ` | ||
<div>foo</div> | ||
<div>0 has foo: true</div> | ||
<div>foo</div> | ||
<div>1 has foo: true</div> | ||
<div>foo</div> | ||
<div>2 has foo: true</div> | ||
` | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/runtime/samples/binding-this-component-each-block/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,11 @@ | ||
<script> | ||
import Foo from './Foo.svelte'; | ||
export let foo = []; | ||
</script> | ||
|
||
{#each Array(3) as _, i} | ||
<Foo bind:this={foo[i]}/> | ||
<div> | ||
{i} has foo: {!!foo[i]} | ||
</div> | ||
{/each} |