-
-
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.
Browse files
Browse the repository at this point in the history
Fix props for logic-less components
- Loading branch information
Showing
28 changed files
with
203 additions
and
41 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
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
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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-binding-parent-supercedes-child-b/Bar.html
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 x = 'no'; | ||
</script> | ||
|
||
<p>Bar: {x}</p> |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-binding-parent-supercedes-child-b/Foo.html
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 x = 'yes'; | ||
</script> | ||
|
||
<p>Foo: {x}</p> |
31 changes: 31 additions & 0 deletions
31
test/runtime/samples/component-binding-parent-supercedes-child-b/_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,31 @@ | ||
export default { | ||
html: ` | ||
<p>Foo: yes</p> | ||
<p>x in parent: yes</p> | ||
`, | ||
|
||
async test({ assert, component, target, window }) { | ||
component.a = false; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Bar: yes</p> | ||
<p>x in parent: yes</p> | ||
`); | ||
|
||
component.a = true; | ||
assert.equal(component.x, 'yes'); | ||
component.x = undefined; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Foo: undefined</p> | ||
<p>x in parent: undefined</p> | ||
`); | ||
|
||
component.a = false; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Bar: no</p> | ||
<p>x in parent: no</p> | ||
`); | ||
} | ||
}; |
15 changes: 15 additions & 0 deletions
15
test/runtime/samples/component-binding-parent-supercedes-child-b/main.html
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,15 @@ | ||
<script> | ||
import Foo from './Foo.html'; | ||
import Bar from './Bar.html'; | ||
|
||
export let a = true; | ||
export let x; | ||
</script> | ||
|
||
{#if a} | ||
<Foo bind:x/> | ||
{:else} | ||
<Bar bind:x/> | ||
{/if} | ||
|
||
<p>x in parent: {x}</p> |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-binding-parent-supercedes-child-c/Bar.html
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 x = 'no'; | ||
</script> | ||
|
||
<p>Bar: {x}</p> |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-binding-parent-supercedes-child-c/Foo.html
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 x = 'yes'; | ||
</script> | ||
|
||
<p>Foo: {x}</p> |
31 changes: 31 additions & 0 deletions
31
test/runtime/samples/component-binding-parent-supercedes-child-c/_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,31 @@ | ||
export default { | ||
html: ` | ||
<p>Foo: yes</p> | ||
<p>x in parent: yes</p> | ||
`, | ||
|
||
async test({ assert, component, target, window }) { | ||
component.a = false; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Bar: yes</p> | ||
<p>x in parent: yes</p> | ||
`); | ||
|
||
component.a = true; | ||
assert.equal(component.x, 'yes'); | ||
component.x = undefined; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Foo: undefined</p> | ||
<p>x in parent: undefined</p> | ||
`); | ||
|
||
component.a = false; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Bar: no</p> | ||
<p>x in parent: no</p> | ||
`); | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/runtime/samples/component-binding-parent-supercedes-child-c/main.html
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.html'; | ||
import Bar from './Bar.html'; | ||
|
||
export let a = true; | ||
export let x; | ||
</script> | ||
|
||
<svelte:component this="{a ? Foo : Bar}" bind:x/> | ||
|
||
<p>x in parent: {x}</p> |
Oops, something went wrong.