From a5f319ef01652f11debdc081b5dad73b82d330ac Mon Sep 17 00:00:00 2001 From: zhanghan2021 Date: Fri, 1 Dec 2023 10:57:37 +0800 Subject: [PATCH] Using pinia to add atune storage counts --- atune/web/src/store/atune.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 atune/web/src/store/atune.ts diff --git a/atune/web/src/store/atune.ts b/atune/web/src/store/atune.ts new file mode 100644 index 00000000..7ad80932 --- /dev/null +++ b/atune/web/src/store/atune.ts @@ -0,0 +1,17 @@ +import { defineStore } from 'pinia'; + +export const useAtuneStore = defineStore('atune', { + state: () => ({ count: 0 }), + getters: { + double: (state) => state.count * 2, + }, + actions: { + increment() { + this.count++; + }, + }, + // persist: { + // enabled: true, // 开启存储 + // strategies: [{ storage: localStorage, paths: ['atune'] }], + // }, +}); -- Gitee