From a883a4f2216ed41213e547a11ffc6f4f02ff520c Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 7 May 2020 11:42:44 +0200 Subject: [PATCH] Clean up code --- .../src/components/instruments/InstrumentFilter.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/components/instruments/InstrumentFilter.vue b/client/src/components/instruments/InstrumentFilter.vue index acbf18bb..03916d2b 100644 --- a/client/src/components/instruments/InstrumentFilter.vue +++ b/client/src/components/instruments/InstrumentFilter.vue @@ -45,11 +45,14 @@ methods: { change(enabled, index) { let type = this.types[index]; - this.types.splice(index, 1, { - ...type, - enabled - }) - console.log(); + this.types = [ + ...this.types.slice(0, index), + { + ...type, + enabled + }, + ...this.types.slice(index + 1), + ]; this.$emit('filter', this.types .filter(t => t.enabled)