File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 22 <li >
33 <span v-bind:class =" {done:todo.done}" >
44 <input type =" checkbox" v-if =" !todo.done" @change =" markDone(todo)" />
5- <!-- <strong>{{todo.id}}.</strong>-->
65 {{todo.task}}
76 </span >
8- <button
9- class =" remove_btn"
10- v-on:click =" $emit('remove-todo',todo.id)"
11- >
7+ <button class =" remove_btn" v-on:click =" $emit('remove-todo',todo.id)" >
128 Удалить
139 </button >
1410 </li >
1511</template >
1612
1713<script >
14+ import TodosService from " ../api/todo.requests" ;
15+
1816export default {
1917 name: " TodoItem" ,
2018 props: {
@@ -24,8 +22,10 @@ export default {
2422 }
2523 },
2624 methods: {
27- markDone (todo ){
25+ async markDone (todo ){
2826 todo .done = ! todo .done
27+ await TodosService .updateTodoStatus (todo .id )
28+ .catch ((error ) => console .error (error .message ))
2929 }
3030 }
3131}
@@ -56,5 +56,6 @@ export default {
5656
5757 .done {
5858 text-decoration : line-through ;
59+
5960 }
6061 </style >
You can’t perform that action at this time.
0 commit comments