From c040cf2c6d7a2ca3c9758b0e8f445ba4a575ff15 Mon Sep 17 00:00:00 2001 From: SaarHV Date: Fri, 27 Jan 2023 14:21:36 +0800 Subject: [PATCH 1/2] Define routes list state interface --- src/stores/interface/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stores/interface/index.ts b/src/stores/interface/index.ts index fad8b78..14d672d 100644 --- a/src/stores/interface/index.ts +++ b/src/stores/interface/index.ts @@ -14,6 +14,13 @@ export interface UserInfosStates { userInfos: UserInfosState; } +// routing List +export interface RoutesListState { + routesList: string[] + isColumnsMenuHover: Boolean + isColumnsNavHover: Boolean + } + // Route cache list export interface KeepAliveNamesState { keepAliveNames: string[]; -- Gitee From a9e431e6c06db141f4a8fb8fb8217921ddd728af Mon Sep 17 00:00:00 2001 From: SaarHV Date: Fri, 27 Jan 2023 14:23:11 +0800 Subject: [PATCH 2/2] Use pinia to store routesList --- src/stores/routesList.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/stores/routesList.ts diff --git a/src/stores/routesList.ts b/src/stores/routesList.ts new file mode 100644 index 0000000..2c9034a --- /dev/null +++ b/src/stores/routesList.ts @@ -0,0 +1,22 @@ +import { defineStore } from 'pinia' +import { RoutesListState } from './interface' + +// Routing List +export const useRoutesList = defineStore('routesList', { + state: (): RoutesListState => ({ + routesList: [], + isColumnsMenuHover: false, + isColumnsNavHover: false + }), + actions: { + async setRoutesList(data: Array) { + this.routesList = data + }, + async setColumnsMenuHover(bool: Boolean) { + this.isColumnsMenuHover = bool + }, + async setColumnsNavHover(bool: Boolean) { + this.isColumnsNavHover = bool + } + } +}) -- Gitee