-
-
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
use anchor comments to preserve order in keyed each blocks with components
- Loading branch information
Showing
4 changed files
with
39 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>{{title}}</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,24 @@ | ||
export default { | ||
data: { | ||
titles: [{ name: 'b' }, { name: 'c' }] | ||
}, | ||
|
||
html: ` | ||
<p>b</p> | ||
<p>c</p> | ||
`, | ||
|
||
test (assert, component, target) { | ||
component.set({ | ||
titles: [{ name: 'a' }, { name: 'b' }, { name: 'c' }] | ||
}); | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>a</p> | ||
<p>b</p> | ||
<p>c</p> | ||
`); | ||
|
||
component.destroy(); | ||
} | ||
}; |
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,13 @@ | ||
{{#each titles as title @name}} | ||
<Nested title="{{title.name}}"/> | ||
{{/each}} | ||
|
||
<script> | ||
import Nested from './Nested.html'; | ||
|
||
export default { | ||
components: { | ||
Nested | ||
} | ||
}; | ||
</script> |