diff --git a/globals.d.ts b/globals.d.ts index 1756ddc..7e31034 100644 --- a/globals.d.ts +++ b/globals.d.ts @@ -1,3 +1,4 @@ + // 通用声明 declare type ClassName = { [className: string]: any } | ClassName[] | string; @@ -5,9 +6,12 @@ declare interface ImportMeta { env: { MODE: 'mock' | 'development' | 'test' | 'release'; }; + glob: (url: string) => {}; } declare module '*.svg' { const content: string; export default content; } + + diff --git a/src/router/index.ts b/src/router/index.ts index a4c723e..bc523be 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,10 +1,9 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'; import routeConfig from '@/config/routes'; -const layoutModules = import.meta.glob('../layouts/*'); +const layoutModules = import.meta.glob('../Layouts/*'); const pagesModules = import.meta.glob('../pages/**/*.vue'); const fristPagesModules = import.meta.glob('../pages/*.vue'); - const modules = Object.assign({}, layoutModules, fristPagesModules, pagesModules); const getMenuRoutes = (list) => { diff --git a/src/store/index.ts b/src/store/index.ts index de2928e..ae405cc 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -8,7 +8,11 @@ export interface State { } export const key: InjectionKey> = Symbol(); + +export const store = createStore({ + modules: { user, + setting, notification, }, }); diff --git a/tsconfig.json b/tsconfig.json index 5de7b38..c7b6225 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,5 @@ "@/*": ["./src/*"] } }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/config/proxy.ts", "src/pages/detail/base/index.js"] + "include": ["**/*.ts", "src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/config/proxy.ts", "src/pages/detail/base/index.js"] }