Skip to content

Commit

Permalink
added tekst to indicate that it couldn't find a new Todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Tijnemijn committed May 27, 2023
1 parent 77a8f71 commit 387df9c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<div class="element-wrapper">
<div class="element-body">
<h1>Welkom bij de Levarne Nulmeting</h1>
<LevButton @clicked="todoListStore().GetTodo()">Krijg een nieuwe ToDo</LevButton>
<LevButton @clicked="todoListStore().GetTodo()">Krijg een nieuwe Todo</LevButton>
<h4 id = "noNewTodo" style="display: none">kom geen nieuwe Todo vinden</h4>
<br>
<br>
<h2>ToDo lijst:</h2>
Expand Down Expand Up @@ -39,6 +40,7 @@ const todoListStore = defineStore('todoList', {
idList: [] as string[],
//the todo list on the page
todoList: document.getElementById("todoList")!,
noNewTodo: document.getElementById("noNewTodo")!,
}),
actions: {
GetTodo(iteration: number = 0) {
Expand All @@ -54,9 +56,13 @@ const todoListStore = defineStore('todoList', {
}
else
{
this.noNewTodo.style.display = "none";
// add item to the list
this.AddTodoToList(response.data.todo);
}
}
else{
this.noNewTodo.style.display = "block";
}
})
.catch((error) => {
Expand Down

0 comments on commit 387df9c

Please sign in to comment.