feat: dynamic import recipe.json

This commit is contained in:
YunYouJun
2023-07-30 20:59:52 +08:00
parent 38b31a5654
commit b526aae2d0
7 changed files with 26 additions and 23 deletions

View File

@@ -22,7 +22,9 @@ const { random, randomRecipes } = useRandomRecipe(count)
<div>随机一下</div>
</button>
<div m="t-8" flex="~ col">
<DishTag v-for="recipe, i in randomRecipes" :key="i" :dish="recipe" />
<template v-for="recipe, i in randomRecipes" :key="i">
<DishTag v-if="recipe" :dish="recipe" />
</template>
</div>
</div>
</template>

View File

@@ -1,10 +1,11 @@
<script lang="ts" setup>
import type { DbRecipeItem } from 'utils/db'
import { tools } from '~/data/food'
import type { RecipeItem } from '~/types'
import { getEmojisFromStuff } from '~/utils'
const props = defineProps<{
dish: RecipeItem
dish: RecipeItem | DbRecipeItem
}>()
const gtm = useGtm()