mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
Recipe Yield
This commit is contained in:
parent
bb46dd1317
commit
4c79d468d7
1 changed files with 30 additions and 43 deletions
|
@ -24,30 +24,23 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script setup lang="ts">
|
||||
import DOMPurify from "dompurify";
|
||||
import { useScaledAmount } from "~/composables/recipes/use-scaled-amount";
|
||||
|
||||
export default defineNuxtComponent({
|
||||
props: {
|
||||
yieldQuantity: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
yieldText: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
scale: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "accent custom-transparent",
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
interface Props {
|
||||
yieldQuantity?: number;
|
||||
yieldText?: string;
|
||||
scale?: number;
|
||||
color?: string;
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
yieldQuantity: 0,
|
||||
yieldText: "",
|
||||
scale: 1,
|
||||
color: "accent custom-transparent",
|
||||
});
|
||||
|
||||
function sanitizeHTML(rawHtml: string) {
|
||||
return DOMPurify.sanitize(rawHtml, {
|
||||
USE_PROFILES: { html: true },
|
||||
|
@ -70,10 +63,4 @@ export default defineNuxtComponent({
|
|||
|
||||
return sanitizeHTML(components.join(" "));
|
||||
});
|
||||
|
||||
return {
|
||||
yieldDisplay,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue