This commit is contained in:
2024-11-28 23:29:55 +01:00
parent 0dda8e760c
commit 70cc1e58e0
2 changed files with 13 additions and 8 deletions

View File

@@ -1,19 +1,19 @@
{ {
"hash": "c9e9bd60", "hash": "b70463bf",
"configHash": "01a344ed", "configHash": "5b7b5918",
"lockfileHash": "15613195", "lockfileHash": "15613195",
"browserHash": "5dd2ada2", "browserHash": "6c715d40",
"optimized": { "optimized": {
"vue": { "vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js", "src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js", "file": "vue.js",
"fileHash": "6afcb8f2", "fileHash": "2fa29594",
"needsInterop": false "needsInterop": false
}, },
"vue-router": { "vue-router": {
"src": "../../vue-router/dist/vue-router.mjs", "src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js", "file": "vue-router.js",
"fileHash": "3d78d312", "fileHash": "5f636aa4",
"needsInterop": false "needsInterop": false
} }
}, },

View File

@@ -44,6 +44,11 @@
filtered_todos.value = todos.value.filter(todo => todo.etat==etat); filtered_todos.value = todos.value.filter(todo => todo.etat==etat);
} }
} }
//Question 10 - delete finished task
function delete_fini(){
todos.value = todos.value.filter(todo => todo.etat !== Etat.FINI);
filtered_todos.value=todos.value;
}
//Question 7 - Delete all_todos //Question 7 - Delete all_todos
// Delete all todos // Delete all todos
@@ -57,7 +62,6 @@
todos.value =todos.value.filter(todo => todo!= this_todo); todos.value =todos.value.filter(todo => todo!= this_todo);
filtered_todos.value=todos.value filtered_todos.value=todos.value
} }
</script> </script>
@@ -72,8 +76,6 @@
<button v-on:click="add_todo()">Add</button> <button v-on:click="add_todo()">Add</button>
<br>
<h1>Filter todos</h1> <h1>Filter todos</h1>
<Filter <Filter
:All_etats="All_etats" :All_etats="All_etats"
@@ -86,6 +88,9 @@
<!--Delete All Todos--> <!--Delete All Todos-->
<DeleteAllTodos @deleteAllTodos="deleteAllTodos " /> <DeleteAllTodos @deleteAllTodos="deleteAllTodos " />
<br>
<button v-on:click="delete_fini()">Delete finished tasks</button>
<br> <br>
<h1>Todos</h1> <h1>Todos</h1>