ingredient checking

This commit is contained in:
vabene1111
2021-01-13 20:12:20 +01:00
parent 082a656210
commit a431031c04
4 changed files with 31 additions and 10 deletions

View File

@ -1,7 +1,8 @@
<template>
<tr>
<tr @click="$emit('checked-state-changed', ingredient)">
<td>
<input type="checkbox">
<i class="far fa-check-circle text-success" v-if="ingredient.checked"></i>
<i class="far fa-check-circle text-primary" v-if="!ingredient.checked"></i>
</td>
<td>
<span v-if="ingredient.amount !== 0">{{ calculateAmount(ingredient.amount) }}</span>
@ -39,6 +40,11 @@ export default {
default: 1,
}
},
data() {
return {
checked: false
}
},
methods: {
calculateAmount: function (x) {
return calculateAmount(x, this.servings)