From dbe8b7a76ffd56cc36e4406822ffde72a3cb3e21 Mon Sep 17 00:00:00 2001 From: "jmeno.prijmeni" Date: Wed, 15 Dec 2021 09:36:49 +0100 Subject: [PATCH] =?UTF-8?q?ko=C5=A1=C3=ADk=20a=20toast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 1 + src/App.vue | 4 ---- src/views/Home.vue | 53 ++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/public/index.html b/public/index.html index a4c3c99..fb2060f 100644 --- a/public/index.html +++ b/public/index.html @@ -13,6 +13,7 @@ We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
+ diff --git a/src/App.vue b/src/App.vue index 5961437..a0ca4ff 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,4 @@ diff --git a/src/views/Home.vue b/src/views/Home.vue index d75446e..c29d65f 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,5 +1,33 @@ @@ -87,6 +111,7 @@ export default { strom: null, stromPocet: 1, kosik: [], + toast: false, }; }, methods: { @@ -96,6 +121,8 @@ export default { polozka: "počet metrů: " + this.posekaniZahrady, cena: this.posekaniZahrady * this.aktivniSluzba.cenaMetr, }) + this.toast = true + this.aktivniSluzba = null }, kosikVysaditStrom: function() { this.kosik.push({ @@ -103,8 +130,20 @@ export default { polozka: "strom: " + this.strom.nazev + ", počet: " + this.stromPocet, cena: this.strom.cena * this.stromPocet, }) + this.toast = true + this.aktivniSluzba = null }, + zavritToast: function() { + this.toast = false + } }, + watch: { + toast: function() { + if (this.toast == true) { + setTimeout(this.zavritToast, 3000) + } + }, + } };