fix: useStorage in ssr & extract random

This commit is contained in:
YunYouJun
2023-07-30 16:31:37 +08:00
parent 033d6adbe6
commit 5164279311
13 changed files with 147 additions and 148 deletions

10
utils/random.ts Normal file
View File

@@ -0,0 +1,10 @@
import type { Recipes } from '../types'
/**
* 生成随机菜谱
* @param recipes
* @returns
*/
export function generateRandomRecipe(recipes: Recipes) {
return recipes[Math.floor(Math.random() * recipes.length)]
}