From 44695d9b6c871bad2366e3fde89969c862341296 Mon Sep 17 00:00:00 2001 From: Cristiano Magro <cristiano.magro@vola.it> Date: Thu, 26 Dec 2024 23:24:20 +0100 Subject: [PATCH] 03 le lezioni di questa sezione --- 03 - lists conditional/lists-cond-assignment-problem/app.js | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/03 - lists conditional/lists-cond-assignment-problem/app.js b/03 - lists conditional/lists-cond-assignment-problem/app.js index e69de29..6d2b2fa 100644 --- a/03 - lists conditional/lists-cond-assignment-problem/app.js +++ b/03 - lists conditional/lists-cond-assignment-problem/app.js @@ -0,0 +1,25 @@ +const app = Vue.createApp({ + data() { + return { + tasks: [], + taskEntered: "", + showTasks: true, + }; + }, + computed: { + toggleTitle(){ + return this.showTasks ? "Hide" : "Show" + } + }, + watch: {}, + methods: { + addTask(){ + this.tasks.push(this.taskEntered); + }, + toggleTasks(){ + this.showTasks = !this.showTasks; + } + }, + }); + + app.mount("#assignment"); \ No newline at end of file -- Gitblit v1.8.0