feat: add storage for tool & stuff & strict

This commit is contained in:
YunYouJun
2022-04-19 02:14:20 +08:00
parent aee764c2d6
commit e45b23dc3f
2 changed files with 9 additions and 5 deletions

View File

@@ -1,11 +1,13 @@
import { acceptHMRUpdate, defineStore } from 'pinia'
export const useRecipeStore = defineStore('recipe', () => {
const strict = ref(false)
const namespace = 'cook'
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 curTool = ref('')
const curTool = useStorage(`${namespace}:tool`, '')
const selectedStuff = computed(() => Array.from(curStuff.value))
// const selectedTools = computed(() => Array.from(curTools.value))