-
-
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.
null out refs to dynamic components - fixes #1596
- Loading branch information
1 parent
63e64c6
commit 87e2241
Showing
4 changed files
with
35 additions
and
0 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 @@ | ||
<p>Foo</p> |
21 changes: 21 additions & 0 deletions
21
test/runtime/samples/dynamic-component-nulled-out/_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,21 @@ | ||
export default { | ||
html: ` | ||
<p>Foo</p> | ||
`, | ||
|
||
nestedTransitions: true, | ||
|
||
test(assert, component, target) { | ||
const state = component.get(); | ||
|
||
component.set({ Foo: null }); | ||
|
||
assert.htmlEqual(target.innerHTML, ``); | ||
|
||
component.set({ Foo: state.Foo }); | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>Foo</p> | ||
`); | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/runtime/samples/dynamic-component-nulled-out/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 @@ | ||
<svelte:component this={Foo}/> | ||
|
||
<script> | ||
import Foo from './Foo.html'; | ||
|
||
export default { | ||
data() { | ||
return { Foo }; | ||
} | ||
}; | ||
</script> |