Clean up code

This commit is contained in:
Ramon Wenger 2020-05-07 11:42:44 +02:00
parent 2ab1073826
commit a883a4f221
1 changed files with 8 additions and 5 deletions

View File

@ -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)