From afe04f569330c63878a1874f93c453b1a188ad9b Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Mon, 13 Nov 2023 22:13:40 +0100 Subject: [PATCH] Refactor --- .../components/project-settings/geodetics.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/www/client/source/src/components/project-settings/geodetics.vue b/lib/www/client/source/src/components/project-settings/geodetics.vue index c31ead4..dc87875 100644 --- a/lib/www/client/source/src/components/project-settings/geodetics.vue +++ b/lib/www/client/source/src/components/project-settings/geodetics.vue @@ -9,7 +9,7 @@ hint="EPSG code of the project's coordinate reference system" persistent-hint type="number" - v-model.number="epsg" + v-model.number="epsg_" > @@ -38,30 +38,30 @@ export default { name: "DougalProjectSettingsGeodetics", - props: [ "value" ], + props: [ "epsg" ], data () { return { - epsg: null + epsg_: null } }, watch: { - value (newValue) { - this.reset(); + epsg () { + if (this.epsg != this.epsg_) { + this.epsg_ = this.epsg; + } } }, methods: { reset () { - for (const key of Object.keys(this.$data)) { - this[key] = this.value[key]; - } + this.epsg_ = this.epsg; }, save () { - this.$emit('input', {...this.$data}); + this.$emit('input', {epsg: this.epsg_}); }, back () {