-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix dynamic components inside elements - fixes #993
- Loading branch information
1 parent
cf94217
commit 7ca36c8
Showing
5 changed files
with
38 additions
and
1 deletion.
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>{{x}}, therefore Bar</p> |
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>{{x}}, therefore Foo</p> |
19 changes: 19 additions & 0 deletions
19
test/runtime/samples/dynamic-component-inside-element/_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,19 @@ | ||
export default { | ||
data: { | ||
x: true | ||
}, | ||
|
||
html: ` | ||
<div><p>true, therefore Foo</p></div> | ||
`, | ||
|
||
test(assert, component, target) { | ||
component.set({ | ||
x: false | ||
}); | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<div><p>false, therefore Bar</p></div> | ||
`); | ||
} | ||
}; |
14 changes: 14 additions & 0 deletions
14
test/runtime/samples/dynamic-component-inside-element/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,14 @@ | ||
<div> | ||
<:Component { x ? Foo : Bar } x='{{x}}'/> | ||
</div> | ||
|
||
<script> | ||
import Foo from './Foo.html'; | ||
import Bar from './Bar.html'; | ||
|
||
export default { | ||
data() { | ||
return { Foo, Bar }; | ||
} | ||
}; | ||
</script> |