1
0
mirror of https://github.com/TandoorRecipes/recipes.git synced 2026-01-11 17:16:59 -05:00

shopping recipe scaling

This commit is contained in:
vabene1111
2024-12-01 14:46:31 +01:00
parent 4149549c88
commit da4abcfce2
2 changed files with 49 additions and 22 deletions

View File

@@ -1,13 +1,7 @@
<template>
<v-dialog width="500" activator="parent" v-model="dialog">
<template v-slot:activator="{ props }">
<slot name="activator">
<v-btn v-bind="props" text="Open Dialog"></v-btn>
</slot>
</template>
<template v-slot:default="{ isActive }">
<v-card >
<v-card>
<v-closable-card-title :title="title" v-model="dialog"></v-closable-card-title>
<v-card-text>
@@ -25,9 +19,12 @@
</v-btn-group>
</v-card-text>
<v-card-actions>
<v-btn @click=" dialog=false">{{ $t('Close') }}</v-btn>
<v-btn color="save" prepend-icon="$save" @click="emit('confirm', mutable_number); dialog=false">{{ $t('Save') }}</v-btn>
</v-card-actions>
</v-card>
</template>
</v-dialog>
</template>
@@ -38,7 +35,10 @@ import {VNumberInput} from 'vuetify/labs/VNumberInput'
import VClosableCardTitle from "@/components/dialogs/VClosableCardTitle.vue"; //TODO remove once component is out of labs
const emit = defineEmits({
change(payload: { number: number }) {
change(payload: number) {
return payload
},
confirm(payload: number) {
return payload
}
})
@@ -76,8 +76,8 @@ function updateNumber(operation: string) {
if (operation === 'sub') {
mutable_number.value = props.number - 1
}
console.log(operation, mutable_number.value)
emit('change', {number: mutable_number.value})
emit('change', mutable_number.value)
}
</script>