todo-vue icon indicating copy to clipboard operation
todo-vue copied to clipboard

Duplicate id in store

Open simonschaufi opened this issue 4 years ago • 0 comments

Hi @drehimself I found an issue with the ids in the store as I have 5 records in the database starting from id 1. Now If I add several more items, the next items will have a manually generated id which will result in the following error:

[Vue warn]: Duplicate keys detected: '4'. This may cause an update error.

The reason for this is that you start with a hard coded id here: https://github.com/drehimself/todo-vue/blob/9487b273cd2362efe41272fc715d76714e8c7f83/src/components/TodoList.vue#L48 How can this be fixed?

simonschaufi avatar Feb 06 '20 23:02 simonschaufi