-
-
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 #1254
- Loading branch information
Showing
5 changed files
with
65 additions
and
12 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
22 changes: 22 additions & 0 deletions
22
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,22 @@ | ||
export default { | ||
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> |