diff --git a/lists-cond-assignment-problem/app.js b/lists-cond-assignment-problem/app.js index e69de29..6e9d67a 100644 --- a/lists-cond-assignment-problem/app.js +++ b/lists-cond-assignment-problem/app.js @@ -0,0 +1,30 @@ +"use strict"; + +const app = Vue.createApp({ + data() { + return { + tasks: [], + newTask: "", + showTasks: true, + }; + }, + computed: { + buttonText() { + if (this.showTasks) { + return "Hide Tasks"; + } else if (!this.showTasks) { + return "Show Tasks"; + } + }, + }, + methods: { + addTask(newTask) { + this.tasks.push(this.newTask); + }, + toggleTasks() { + this.showTasks = !this.showTasks; + }, + }, +}); + +app.mount("#assignment"); diff --git a/lists-cond-assignment-problem/index.html b/lists-cond-assignment-problem/index.html index 13ed827..986e992 100644 --- a/lists-cond-assignment-problem/index.html +++ b/lists-cond-assignment-problem/index.html @@ -19,14 +19,16 @@

Assignment

- - -