mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 13:05:21 +02:00
feat: Migrate to Nuxt 3 framework (#5184)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
89ab7fac25
commit
c24d532608
403 changed files with 23959 additions and 19557 deletions
|
@ -1,24 +1,34 @@
|
|||
<template>
|
||||
<div v-if="scaledAmount" class="d-flex align-center">
|
||||
<v-row no-gutters class="d-flex flex-wrap align-center" style="font-size: larger;">
|
||||
<v-icon x-large left color="primary">
|
||||
<div
|
||||
v-if="scaledAmount"
|
||||
class="d-flex align-center"
|
||||
>
|
||||
<v-row
|
||||
no-gutters
|
||||
class="d-flex flex-wrap align-center"
|
||||
style="font-size: larger;"
|
||||
>
|
||||
<v-icon
|
||||
size="x-large"
|
||||
start
|
||||
color="primary"
|
||||
>
|
||||
{{ $globals.icons.bread }}
|
||||
</v-icon>
|
||||
<p class="my-0">
|
||||
<span class="font-weight-bold">{{ $i18n.tc("recipe.yield") }}</span><br>
|
||||
<p class="my-0 opacity-80">
|
||||
<span class="font-weight-bold">{{ $t("recipe.yield") }}</span><br>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<span v-html="scaledAmount"></span> {{ text }}
|
||||
<span v-html="scaledAmount" /> {{ text }}
|
||||
</p>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, computed } from "@nuxtjs/composition-api";
|
||||
import DOMPurify from "dompurify";
|
||||
import { useScaledAmount } from "~/composables/recipes/use-scaled-amount";
|
||||
|
||||
export default defineComponent({
|
||||
export default defineNuxtComponent({
|
||||
props: {
|
||||
yieldQuantity: {
|
||||
type: Number,
|
||||
|
@ -34,11 +44,10 @@ export default defineComponent({
|
|||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "accent custom-transparent"
|
||||
default: "accent custom-transparent",
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
|
||||
function sanitizeHTML(rawHtml: string) {
|
||||
return DOMPurify.sanitize(rawHtml, {
|
||||
USE_PROFILES: { html: true },
|
||||
|
@ -47,7 +56,7 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
const scaledAmount = computed(() => {
|
||||
const {scaledAmountDisplay} = useScaledAmount(props.yieldQuantity, props.scale);
|
||||
const { scaledAmountDisplay } = useScaledAmount(props.yieldQuantity, props.scale);
|
||||
return scaledAmountDisplay;
|
||||
});
|
||||
const text = sanitizeHTML(props.yield);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue