Skip to content

Commit efb2fc9

Browse files
ramsesgarateRamses Garate
andauthored
fix: add id in addTodo method for tutorial 7 solution (vuejs#1445)
Co-authored-by: Ramses Garate <[email protected]>
1 parent 50c3d8c commit efb2fc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/tutorial/src/step-7/_hint/App/composition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
])
1414

1515
function addTodo() {
16-
todos.value.push({ text: newTodo.value })
16+
todos.value.push({ id: id++, text: newTodo.value })
1717
newTodo.value = ''
1818
}
1919

src/tutorial/src/step-7/_hint/App/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default {
1414
},
1515
methods: {
1616
addTodo() {
17-
this.todos.push({ text: this.newTodo })
17+
this.todos.push({ id: id++, text: this.newTodo })
1818
this.newTodo = ''
1919
},
2020
removeTodo(todo) {

0 commit comments

Comments
 (0)