-
-
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.
- Loading branch information
1 parent
ffa45dd
commit 4cb8eff
Showing
3 changed files
with
63 additions
and
9 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
25 changes: 25 additions & 0 deletions
25
test/runtime/samples/deconflict-elements-indexes/_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,25 @@ | ||
export default { | ||
solo: true, | ||
show: true, | ||
|
||
html: ` | ||
<div> | ||
<i>one</i> | ||
</div> | ||
`, | ||
|
||
preserveIdentifiers: true, | ||
|
||
test(assert, component, target) { | ||
const { tagList } = component.get(); | ||
tagList.push('two'); | ||
component.set({ tagList }); | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<div> | ||
<i>one</i> | ||
<i>two</i> | ||
</div> | ||
`); | ||
} | ||
}; |
24 changes: 24 additions & 0 deletions
24
test/runtime/samples/deconflict-elements-indexes/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,24 @@ | ||
<div> | ||
{{#each tagList as tag, i}} | ||
<i on:click='remove(i)'> | ||
{{tag}} | ||
</i> | ||
{{/each}} | ||
</div> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
inProgress: false, | ||
tagList: ['one'] | ||
}; | ||
}, | ||
|
||
methods: { | ||
remove(index) { | ||
// ... | ||
} | ||
} | ||
}; | ||
</script> |