Skip to content

Commit d07963e

Browse files
Fix duplicate key error in Vue example (tastejs#2084)
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent 601c114 commit d07963e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/vue/js/app.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
if (!value) {
7676
return;
7777
}
78-
this.todos.push({ id: this.todos.length + 1, title: value, completed: false });
78+
// TODO: Use a proper UUID instead of `Date.now()`.
79+
this.todos.push({ id: Date.now(), title: value, completed: false });
7980
this.newTodo = '';
8081
},
8182

0 commit comments

Comments
 (0)