commit | author | age | ||
44695d | 1 | const app = Vue.createApp({ |
CM | 2 | data() { |
3 | return { | |
4 | tasks: [], | |
5 | taskEntered: "", | |
6 | showTasks: true, | |
7 | }; | |
8 | }, | |
9 | computed: { | |
10 | toggleTitle(){ | |
11 | return this.showTasks ? "Hide" : "Show" | |
12 | } | |
13 | }, | |
14 | watch: {}, | |
15 | methods: { | |
16 | addTask(){ | |
17 | this.tasks.push(this.taskEntered); | |
18 | }, | |
19 | toggleTasks(){ | |
20 | this.showTasks = !this.showTasks; | |
21 | } | |
22 | }, | |
23 | }); | |
24 | ||
25 | app.mount("#assignment"); |