delete button for tags/categories

This commit is contained in:
Hayden 2021-01-03 10:01:49 -09:00
parent b5474a6e81
commit 8a99155356

View File

@ -20,10 +20,7 @@
<div class="my-2"></div> <div class="my-2"></div>
<v-row dense disabled> <v-row dense disabled>
<v-col sm="5"> <v-col sm="5">
<v-text-field <v-text-field label="Servings" v-model="value.recipeYield">
label="Servings"
v-model="value.recipeYield"
>
</v-text-field> </v-text-field>
</v-col> </v-col>
<v-col></v-col> <v-col></v-col>
@ -74,7 +71,13 @@
v-model="value.categories" v-model="value.categories"
> >
<template v-slot:selection="data"> <template v-slot:selection="data">
<v-chip :input-value="data.selected" close color="secondary" dark> <v-chip
:input-value="data.selected"
close
@click:close="removeCategory(data.index)"
color="secondary"
dark
>
{{ data.item }} {{ data.item }}
</v-chip> </v-chip>
</template> </template>
@ -83,7 +86,13 @@
<h2 class="mt-4">Tags</h2> <h2 class="mt-4">Tags</h2>
<v-combobox dense multiple chips deletable-chips v-model="value.tags"> <v-combobox dense multiple chips deletable-chips v-model="value.tags">
<template v-slot:selection="data"> <template v-slot:selection="data">
<v-chip :input-value="data.selected" close color="secondary" dark> <v-chip
:input-value="data.selected"
close
@click:close="removeTags(data.index)"
color="secondary"
dark
>
{{ data.item }} {{ data.item }}
</v-chip> </v-chip>
</template> </template>
@ -255,6 +264,12 @@ export default {
removeNote(index) { removeNote(index) {
this.value.notes.splice(index, 1); this.value.notes.splice(index, 1);
}, },
removeCategory(index) {
this.value.categories.splice(index, 1);
},
removeTags(index) {
this.value.tags.splice(index, 1);
},
}, },
}; };
</script> </script>