From 12bb2005bbea28626c5b79133bfcbc4409b292f8 Mon Sep 17 00:00:00 2001 From: Greenscreener Date: Sat, 23 Jan 2021 09:58:34 +0100 Subject: [PATCH] Avoided mutating props directly. --- .../src/components/edit/Hlava.vue | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/form/res-judicata/src/components/edit/Hlava.vue b/form/res-judicata/src/components/edit/Hlava.vue index 085cd79..25c69bf 100644 --- a/form/res-judicata/src/components/edit/Hlava.vue +++ b/form/res-judicata/src/components/edit/Hlava.vue @@ -2,18 +2,18 @@

- {{ displaytitle }} + {{ localTitle || "Název hlavy" }}

- {{ displaytext }} + {{ localText || "Text hlavy" }}

- +

- +

Smazat hlavu @@ -40,26 +40,26 @@ export default { this.isactive = true; }, makeinactive: function () { - this.$emit('update:text', this.text) - this.$emit('update:title', this.title) this.isactive = false; } }, computed: { - displaytitle: function () { - if (!this.title) { - return "Název hlavy" - } else { - return this.title - } + localTitle: { + get: function() { + return this.title + }, + set: function (value) { + this.$emit('update:title', value) + } }, - displaytext: function () { - if (!this.text) { - return "Text hlavy" - } else { - return this.text - } + localText: { + get: function() { + return this.text + }, + set: function (value) { + this.$emit('update:text', value) + } } } } - \ No newline at end of file +