diff --git a/src/components.d.ts b/src/components.d.ts index 7b122d4..ae0906a 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -19,6 +19,8 @@ declare module '@vue/runtime-core' { ReloadPrompt: typeof import('./components/ReloadPrompt.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + Search: typeof import('./components/Search.vue')['default'] + SearchFood: typeof import('./components/SearchFood.vue')['default'] StapleTag: typeof import('./components/tags/StapleTag.vue')['default'] Switch: typeof import('./components/Switch.vue')['default'] ToggleMode: typeof import('./components/ToggleMode.vue')['default'] diff --git a/src/components/ChooseFood.vue b/src/components/ChooseFood.vue index d952f3a..6879c48 100644 --- a/src/components/ChooseFood.vue +++ b/src/components/ChooseFood.vue @@ -5,7 +5,7 @@ import type { StuffItem } from '~/data/food' import { meat, staple, tools, vegetable } from '~/data/food' import recipeData from '~/data/recipe.json' import type { Recipe, RecipeItem } from '~/types' -import { useRecipeStore } from '~/stores/recipe' +import { useRecipeStore } from '~/store/recipe' import { useInvisibleElement } from '~/composables/helper' import { useEmojiAnimation } from '~/composables/animation' @@ -161,6 +161,8 @@ const randomRecipe = ref(generateRandomRecipe())
+ +
diff --git a/src/components/InstallPwa.vue b/src/components/InstallPwa.vue index 922c0ef..1c18aa6 100644 --- a/src/components/InstallPwa.vue +++ b/src/components/InstallPwa.vue @@ -1,5 +1,5 @@ + + diff --git a/src/components/ToggleMode.vue b/src/components/ToggleMode.vue index 3a56cea..dc3167f 100644 --- a/src/components/ToggleMode.vue +++ b/src/components/ToggleMode.vue @@ -1,6 +1,6 @@ diff --git a/src/stores/app.ts b/src/store/app.ts similarity index 100% rename from src/stores/app.ts rename to src/store/app.ts diff --git a/src/stores/recipe.ts b/src/store/recipe.ts similarity index 95% rename from src/stores/recipe.ts rename to src/store/recipe.ts index 467a0f2..8c85698 100644 --- a/src/stores/recipe.ts +++ b/src/store/recipe.ts @@ -10,6 +10,11 @@ const namespace = 'cook' export type SearchMode = 'survival' | 'loose' | 'strict' export const useRecipeStore = defineStore('recipe', () => { + /** + * 搜索关键字 + */ + const keyword = ref('') + // can not exported const curStuff = useStorage(`${namespace}:stuff`, new Set()) // const curTools = ref(new Set()) @@ -59,6 +64,7 @@ export const useRecipeStore = defineStore('recipe', () => { } return { + keyword, curTool, curMode, selectedStuff, diff --git a/src/stores/user.ts b/src/store/user.ts similarity index 100% rename from src/stores/user.ts rename to src/store/user.ts diff --git a/src/styles/index.scss b/src/styles/index.scss index 208f00d..5a802a7 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -13,6 +13,10 @@ html.dark { background: #121212; } +input:focus { + outline: none; +} + #nprogress { pointer-events: none; } diff --git a/src/utils/pwa.ts b/src/utils/pwa.ts index 755fec1..e089ed3 100644 --- a/src/utils/pwa.ts +++ b/src/utils/pwa.ts @@ -1,5 +1,5 @@ import { isClient } from '@vueuse/core' -import { useAppStore } from '~/stores/app' +import { useAppStore } from '~/store/app' /** * https://web.dev/customize-install/#detect-install diff --git a/test/component.test.ts b/test/component.test.ts index 6379c8a..f0807db 100644 --- a/test/component.test.ts +++ b/test/component.test.ts @@ -3,7 +3,7 @@ import { describe, it } from 'vitest' // import { createTestingPinia } from '@pinia/testing' // import ChooseFood from '../src/components/ChooseFood.vue' -// import { useRecipeStore } from '~/stores/recipe' +// import { useRecipeStore } from '~/store/recipe' describe('ChooseFood.vue', () => { it('should render', async () => { diff --git a/test/recipe.test.ts b/test/recipe.test.ts index ccdbe8c..c185b6d 100644 --- a/test/recipe.test.ts +++ b/test/recipe.test.ts @@ -3,7 +3,7 @@ import { createPinia, setActivePinia } from 'pinia' import { useRecipe } from '~/composables/recipe' import type { Recipe } from '~/types' import recipeData from '~/data/recipe.json' -import { useRecipeStore } from '~/stores/recipe' +import { useRecipeStore } from '~/store/recipe' const recipe = ref(recipeData as Recipe)