fix: remove strict mode
This commit is contained in:
@@ -14,12 +14,14 @@ const rStore = useRecipeStore()
|
||||
const curStuff = computed(() => rStore.selectedStuff)
|
||||
const curTools = computed(() => rStore.selectedTools)
|
||||
|
||||
const strict = ref(false)
|
||||
// 默认严格模式
|
||||
const strict = ref(true)
|
||||
const displayedRecipe = computed(() => {
|
||||
return recipe.value.filter((item) => {
|
||||
if (strict.value) {
|
||||
const stuffFlag = curStuff.value.every(stuff => item.stuff.includes(stuff))
|
||||
const toolFlag = curTools.value.every(tool => item.tools?.includes(tool))
|
||||
// const toolFlag = curTools.value.every(tool => item.tools?.includes(tool))
|
||||
const toolFlag = curTools.value.some(tool => item.tools?.includes(tool))
|
||||
return stuffFlag && toolFlag
|
||||
}
|
||||
else {
|
||||
@@ -136,20 +138,20 @@ const clickTool = (item: StuffItem) => {
|
||||
</ToolTag>
|
||||
</div>
|
||||
|
||||
<div class="inline-flex justify-center items-center" m="y-4">
|
||||
<!-- <div class="inline-flex justify-center items-center" m="y-4">
|
||||
<span :class="!strict && 'text-green-600'" font="bold" m="x-1" @click="strict = false">
|
||||
可做的所有菜
|
||||
</span>
|
||||
<label m="x-1" class="switch">
|
||||
<input v-model="strict" type="checkbox">
|
||||
<span class="slider round" />
|
||||
<span class="inline-flex justify-center items-center slider round" />
|
||||
</label>
|
||||
<span :class="strict && 'text-green-600'" font="bold" m="x-1" @click="strict = true">
|
||||
一起做一道菜
|
||||
</span>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div p="2 y-4" class="transition shadow hover:shadow-md" bg="gray-400/8">
|
||||
<div m="2" p="2" class="transition shadow hover:shadow-md" bg="gray-400/8">
|
||||
<h2 text="xl" font="bold" p="1">
|
||||
🍲 今天的菜
|
||||
<br>
|
||||
@@ -217,7 +219,7 @@ $size: 20px;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: green;
|
||||
@apply bg-green-600;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
|
||||
@@ -42,16 +42,14 @@
|
||||
金针菇菜卷,菌菇、胡萝卜、包菜,https://www.bilibili.com/video/BV1aW411H7fZ,简单,快手菜,,一口大锅
|
||||
口蘑鸡胸肉,菌菇、鸡胸肉,https://www.bilibili.com/video/BV1AP4y1w7y6,简单,快手菜,煎,一口大锅
|
||||
椒盐炸蘑菇,菌菇、鸡蛋,https://www.bilibili.com/video/BV1P54y1L7FS,简单,单一食材,炸,一口大锅
|
||||
潮汕杂菇煲,菌菇、猪肉,https://www.bilibili.com/video/BV15E411K7B5,简单,
|
||||
,炒,一口大锅
|
||||
潮汕杂菇煲,菌菇、猪肉,https://www.bilibili.com/video/BV15E411K7B5,简单,,炒,一口大锅
|
||||
烤蘑菇,菌菇、洋葱、猪肉,https://www.bilibili.com/video/BV1T3411e7VG,普通,,烤,空气炸锅
|
||||
口蘑汤,菌菇,https://www.bilibili.com/video/BV1e64y1h776,简单,汤,煎、炖,一口大锅
|
||||
蘑菇浓汤,蘑菇、洋葱、芹菜,https://www.bilibili.com/video/BV1Ut411C7Cu,普通,汤,炖,一口大锅
|
||||
蒜香口蘑牛肉粒,蘑菇、牛肉,https://www.bilibili.com/video/BV1Nm4y197ev,简单,荤素搭配,炒,一口大锅
|
||||
浇汁西兰花,西兰花,https://www.bilibili.com/video/BV1jq4y1M7jR,简单,单一食材,煮,一口大锅
|
||||
蒜蓉西兰花,西兰花,https://www.bilibili.com/video/BV1fy4y1W7z5,简单,单一食材,炒,一口大锅
|
||||
西兰花炒虾仁,西兰花、虾,https://www.bilibili.com/video/BV1nv411B78i,简单,
|
||||
,炒,一口大锅
|
||||
西兰花炒虾仁,西兰花、虾,https://www.bilibili.com/video/BV1nv411B78i,简单,,炒,一口大锅
|
||||
白灼西兰花,西兰花,https://www.bilibili.com/video/BV1o4411A7dC,简单,健康,煮,一口大锅
|
||||
鸡蛋西兰花豆腐羹,西兰花、豆腐、鸡蛋,https://www.bilibili.com/video/BV164411g77n,简单,,炖,一口大锅
|
||||
水波蛋,鸡蛋,https://www.bilibili.com/video/BV1TT4y127vu,简单,,煮,一口大锅
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
好的,今天我们来做菜!
|
||||
</p>
|
||||
<p text="sm" opacity="80">
|
||||
选你囤的食材和有的厨具,看看今天能做什么菜吧!
|
||||
选中你囤的食材和有的厨具,看看今天能做什么菜吧!
|
||||
</p>
|
||||
<p>
|
||||
<ChooseFood />
|
||||
|
||||
Reference in New Issue
Block a user