Closed
Description
Version
2.5.13
Reproduction link
https://jsfiddle.net/56zfwbe5/1/
Steps to reproduce
- Open the jsfiddle demo
- Open your console
- Run the demo
- now you should see an error like this: [Vue warn]: Duplicate keys detected:
What is expected?
Children inside a repeated <template>
should share the same keys as they should both re-render if the target element changes.
What is actually happening?
Errors are raised with the message : [Vue warn]: Duplicate keys detected is raised.
Cause
This behavior is linked to this PR and was also references in this issue
Workaround
You could avoid this error by adding some prefix / suffix
<template v-for="it in items">
<li :key="it.id + '-label'">{{it.label}}</li>
<li :key="it.id + '-separator'" class="separator">></li>
</template>
Metadata
Metadata
Assignees
Labels
No labels