mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
simplify and just use computed property
This commit is contained in:
parent
5a256e07f9
commit
81ab79f9fa
1 changed files with 2 additions and 16 deletions
|
@ -66,7 +66,7 @@
|
|||
<v-card-text class="mt-n5">
|
||||
<div class="mt-4 d-flex align-center">
|
||||
<v-text-field
|
||||
:model-value="yieldQuantityEditorValue"
|
||||
:model-value="yieldQuantity"
|
||||
type="number"
|
||||
:min="0"
|
||||
variant="underlined"
|
||||
|
@ -178,21 +178,8 @@ export default defineNuxtComponent({
|
|||
: "";
|
||||
});
|
||||
|
||||
// only update yield quantity when the menu opens, so we don't override the user's input
|
||||
const yieldQuantityEditorValue = ref(recipeYieldAmount.value.scaledAmount);
|
||||
watch(
|
||||
() => menu.value,
|
||||
() => {
|
||||
if (!menu.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
yieldQuantityEditorValue.value = recipeYieldAmount.value.scaledAmount;
|
||||
},
|
||||
);
|
||||
|
||||
const disableDecrement = computed(() => {
|
||||
return recipeYieldAmount.value.scaledAmount <= 1;
|
||||
return yieldQuantity.value <= 1;
|
||||
});
|
||||
|
||||
return {
|
||||
|
@ -202,7 +189,6 @@ export default defineNuxtComponent({
|
|||
recalculateScale,
|
||||
yieldDisplay,
|
||||
yieldQuantity,
|
||||
yieldQuantityEditorValue,
|
||||
disableDecrement,
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue