mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
Print Settings Dialog
This commit is contained in:
parent
a5d722e8e5
commit
8d78af6693
1 changed files with 12 additions and 35 deletions
|
@ -44,6 +44,7 @@
|
||||||
<v-switch
|
<v-switch
|
||||||
v-model="preferences.showDescription"
|
v-model="preferences.showDescription"
|
||||||
hide-details
|
hide-details
|
||||||
|
color="primary"
|
||||||
:label="$t('recipe.description')"
|
:label="$t('recipe.description')"
|
||||||
/>
|
/>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
<v-switch
|
<v-switch
|
||||||
v-model="preferences.showNotes"
|
v-model="preferences.showNotes"
|
||||||
hide-details
|
hide-details
|
||||||
|
color="primary"
|
||||||
:label="$t('recipe.notes')"
|
:label="$t('recipe.notes')"
|
||||||
/>
|
/>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -63,6 +65,7 @@
|
||||||
<v-switch
|
<v-switch
|
||||||
v-model="preferences.showNutrition"
|
v-model="preferences.showNutrition"
|
||||||
hide-details
|
hide-details
|
||||||
|
color="primary"
|
||||||
:label="$t('recipe.nutrition')"
|
:label="$t('recipe.nutrition')"
|
||||||
/>
|
/>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -83,45 +86,19 @@
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recipe } from "~/lib/api/types/recipe";
|
import type { Recipe } from "~/lib/api/types/recipe";
|
||||||
import { ImagePosition, useUserPrintPreferences } from "~/composables/use-users/preferences";
|
import { ImagePosition, useUserPrintPreferences } from "~/composables/use-users/preferences";
|
||||||
import RecipePrintView from "~/components/Domain/Recipe/RecipePrintView.vue";
|
import RecipePrintView from "~/components/Domain/Recipe/RecipePrintView.vue";
|
||||||
import type { NoUndefinedField } from "~/lib/api/types/non-generated";
|
import type { NoUndefinedField } from "~/lib/api/types/non-generated";
|
||||||
|
|
||||||
export default defineNuxtComponent({
|
interface Props {
|
||||||
components: {
|
recipe?: NoUndefinedField<Recipe>;
|
||||||
RecipePrintView,
|
}
|
||||||
},
|
withDefaults(defineProps<Props>(), {
|
||||||
props: {
|
recipe: undefined,
|
||||||
modelValue: {
|
});
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
const dialog = defineModel<boolean>({ default: false });
|
||||||
},
|
|
||||||
recipe: {
|
|
||||||
type: Object as () => NoUndefinedField<Recipe>,
|
|
||||||
default: undefined,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ["update:modelValue"],
|
|
||||||
setup(props, context) {
|
|
||||||
const preferences = useUserPrintPreferences();
|
const preferences = useUserPrintPreferences();
|
||||||
|
|
||||||
// V-Model Support
|
|
||||||
const dialog = computed({
|
|
||||||
get: () => {
|
|
||||||
return props.modelValue;
|
|
||||||
},
|
|
||||||
set: (val) => {
|
|
||||||
context.emit("update:modelValue", val);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
dialog,
|
|
||||||
ImagePosition,
|
|
||||||
preferences,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue