diff --git a/src/store/modules/route-config.ts b/src/store/modules/route-config.ts index c6fedee..b187f35 100644 --- a/src/store/modules/route-config.ts +++ b/src/store/modules/route-config.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import router from "@/router/index.ts"; +import router from "@/router/index"; import { RouteRecordRaw } from "vue-router"; import { getMenuListAPI } from "@/api/modules/system/index"; import { moduleReplacement, linearArray } from "@/router/route-output"; @@ -103,7 +103,6 @@ export const useRoutesConfigStore = defineStore("route-config", { tree[0].redirect = tree[0].children[0].path; // 6、动态添加路由 tree.forEach((route: RouteRecordRaw) => router.addRoute(route)); - console.log("最终路由", tree); // 7、缓存一维路由 this.routeList = tree[0].children; } diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index b15930c..ce20f09 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -19,4 +19,3 @@ declare module "@/directives/modules/custom"; declare module "mockjs"; declare module "@/store/modules/route-config"; declare module "@arco-design/*"; -declare module "vue-router"; diff --git a/tsconfig.json b/tsconfig.json index bcbaa47..3f7f31a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,27 @@ { // 编译选项 "compilerOptions": { + /* ES */ "target": "ESNext", // 指定ECMAScript目标版本 "module": "ESNext", // 设置程序的模块系统 "lib": ["ESNext", "DOM"], //TS需要引用的库,即声明文件,es5 默认引用dom、es5、scripthost,如需要使用es的高级版本特性,通常都需要配置,如es8的数组新特性需要引入"ES2019.Array", "skipLibCheck": true, //忽略所有的声明文件( *.d.ts)的类型检查 + + /* Bundler mode */ "moduleResolution": "bundler", //模块解析策略。默认使用node的模块解析策略 "allowImportingTsExtensions": true, // 允许导入包含 TypeScript 文档扩展名。 "resolveJsonModule": true, //允许导入扩展名为".json"的模块 "isolatedModules": true, //将每个文件作为单独的模块(与"ts.transpileModule"类似)。 "noEmit": true, // 不输出文件,即编译后不会生成任何js文件 "jsx": "preserve", //preserve模式,在preserve模式下生成代码中会保留JSX以供后续的转换操作使用 + + /* Standard */ "strict": true, //启用所有严格类型检查选项 "noUnusedLocals": true, // 若有未使用的局部变量则抛错 "noUnusedParameters": true, // 检若有未使用的函数参数则抛错 "noFallthroughCasesInSwitch": true, // 防止switch语句贯穿(即如果没有break语句后面不会执行) + + /* path */ "baseUrl": "./", // 解析非相对模块的基地址,默认是当前目录 "paths": { // 模块名到基于 baseUrl的路径映射的列表