From 3d54022d9ceea2a777f3dd72f7b6ec176aaedfb2 Mon Sep 17 00:00:00 2001 From: Gzx1999 Date: Tue, 14 Nov 2023 13:47:19 +0800 Subject: [PATCH] define router store --- frontend/src/stores/counter.ts | 12 ------------ frontend/src/stores/router.ts | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 12 deletions(-) delete mode 100644 frontend/src/stores/counter.ts create mode 100644 frontend/src/stores/router.ts diff --git a/frontend/src/stores/counter.ts b/frontend/src/stores/counter.ts deleted file mode 100644 index b6757ba..0000000 --- a/frontend/src/stores/counter.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ref, computed } from 'vue' -import { defineStore } from 'pinia' - -export const useCounterStore = defineStore('counter', () => { - const count = ref(0) - const doubleCount = computed(() => count.value * 2) - function increment() { - count.value++ - } - - return { count, doubleCount, increment } -}) diff --git a/frontend/src/stores/router.ts b/frontend/src/stores/router.ts new file mode 100644 index 0000000..e2c2cf6 --- /dev/null +++ b/frontend/src/stores/router.ts @@ -0,0 +1,18 @@ +import { ref } from 'vue' +import { defineStore } from 'pinia' + +export interface Menu { + path: string + title: string + hidden: boolean + panel : string + icon: string + subMenus: Menu[] | null +} + +export const routerStore = defineStore('router', () => { + const menus = ref() + + return { menus } +}) + -- Gitee