diff --git a/scripts/convert.ts b/scripts/convert.ts index 27e09e5..05f5b82 100644 --- a/scripts/convert.ts +++ b/scripts/convert.ts @@ -3,6 +3,7 @@ import fs from 'fs' import path from 'path' import consola from 'consola' import type { Recipe, RecipeItem } from '~/types' +import { generateEmojisFromStuff } from '~/utils' const recipeCsvFile = path.resolve(__dirname, '../src/data/recipe.csv') const recipeJsonFile = path.resolve(__dirname, '../src/data/recipe.json') @@ -22,9 +23,11 @@ function run() { lines.slice(1).forEach((line) => { if (line) { const attrs = line.split(',') + const stuff = attrs[1].trim().split(sep) recipeJson.push({ name: attrs[0].trim(), - stuff: attrs[1].trim().split(sep), + stuff, + emojis: generateEmojisFromStuff(stuff), link: attrs[2].trim(), difficulty: attrs[3] && attrs[3].trim() as RecipeItem['difficulty'], tags: attrs[4] ? attrs[4].trim().split(sep) : [], diff --git a/src/components/ChooseFood.vue b/src/components/ChooseFood.vue index a153366..c64b15d 100644 --- a/src/components/ChooseFood.vue +++ b/src/components/ChooseFood.vue @@ -8,11 +8,7 @@ import { meat, staple, tools, vegetable } from '~/data/food' import recipeData from '~/data/recipe.json' import type { Recipe } from '~/types' import { useRecipeStore } from '~/stores/recipe' -import { generateEmojisFromStuff } from '~/utils' -(recipeData as Recipe).forEach((recipe) => { - recipe.emojis = generateEmojisFromStuff(recipe.stuff) -}) const recipe = ref(recipeData as Recipe) const rStore = useRecipeStore() diff --git a/src/components/DishTag.vue b/src/components/DishTag.vue index 1d8779d..e974dfa 100644 --- a/src/components/DishTag.vue +++ b/src/components/DishTag.vue @@ -1,5 +1,6 @@ diff --git a/src/pages/about.md b/src/pages/about.md index 53a0d5c..a8e495a 100644 --- a/src/pages/about.md +++ b/src/pages/about.md @@ -25,8 +25,7 @@ title: 关于 -
-
+如果您有任何建议或反馈可前往 [Issues](https://github.com/YunYouJun/cook/issues) / [Discussions](https://github.com/YunYouJun/cook/issues)。
Made by