feat: add storage for tool & stuff & strict
This commit is contained in:
@@ -38,7 +38,9 @@ title: 关于
|
|||||||
- 晴方啾
|
- 晴方啾
|
||||||
- 课代表阿伟
|
- 课代表阿伟
|
||||||
|
|
||||||
<br />
|
## **友情提示**
|
||||||
|
|
||||||
|
点击首页最上方的大锅图标,可以清空所选食材和工具。(本来想当作彩蛋,但是感觉还挺实用的。)
|
||||||
|
|
||||||
<div class="flex justify-center items-center">
|
<div class="flex justify-center items-center">
|
||||||
Made by
|
Made by
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { acceptHMRUpdate, defineStore } from 'pinia'
|
import { acceptHMRUpdate, defineStore } from 'pinia'
|
||||||
|
|
||||||
export const useRecipeStore = defineStore('recipe', () => {
|
const namespace = 'cook'
|
||||||
const strict = ref(false)
|
|
||||||
|
|
||||||
const curStuff = ref(new Set<string>())
|
export const useRecipeStore = defineStore('recipe', () => {
|
||||||
|
const strict = useStorage(`${namespace}:strict`, false)
|
||||||
|
|
||||||
|
const curStuff = useStorage(`${namespace}:stuff`, new Set<string>())
|
||||||
// const curTools = ref(new Set<string>())
|
// const curTools = ref(new Set<string>())
|
||||||
const curTool = ref('')
|
const curTool = useStorage(`${namespace}:tool`, '')
|
||||||
|
|
||||||
const selectedStuff = computed(() => Array.from(curStuff.value))
|
const selectedStuff = computed(() => Array.from(curStuff.value))
|
||||||
// const selectedTools = computed(() => Array.from(curTools.value))
|
// const selectedTools = computed(() => Array.from(curTools.value))
|
||||||
|
|||||||
Reference in New Issue
Block a user