Browse Source

chore: typo

Vben 3 years ago
parent
commit
7dce50cb1f

+ 1 - 1
src/api/sys/model/menuModel.ts

@@ -1,4 +1,4 @@
-import { RouteMeta } from '/@/router/types';
+import type { RouteMeta } from 'vue-router';
 export interface RouteItem {
   path: string;
   component: any;

+ 0 - 2
src/layouts/default/content/index.vue

@@ -5,9 +5,7 @@
 </template>
 <script lang="ts">
   import { defineComponent } from 'vue';
-
   import PageLayout from '/@/layouts/page/index.vue';
-
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useRootSetting } from '/@/hooks/setting/useRootSetting';
   import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';

+ 0 - 2
src/layouts/default/content/useContentContext.ts

@@ -1,8 +1,6 @@
 import type { InjectionKey, ComputedRef } from 'vue';
 import { createContext, useContext } from '/@/hooks/core/useContext';
 
-import {} from 'vue';
-
 export interface ContentContextProps {
   contentHeight: ComputedRef<number>;
   setPageHeight: (height: number) => Promise<void>;

+ 2 - 2
src/router/routes/basic.ts

@@ -47,7 +47,7 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = {
 
 export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
   path: '/error-log',
-  name: 'errorLog',
+  name: 'ErrorLog',
   component: LAYOUT,
   meta: {
     title: 'ErrorLog',
@@ -56,7 +56,7 @@ export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
   children: [
     {
       path: 'list',
-      name: 'errorLogList',
+      name: 'ErrorLogList',
       component: () => import('/@/views/sys/error-log/index.vue'),
       meta: {
         title: t('routes.basic.errorLogList'),

+ 2 - 45
src/router/types.ts

@@ -1,6 +1,5 @@
-import type { RouteRecordRaw } from 'vue-router';
+import type { RouteRecordRaw, RouteMeta } from 'vue-router';
 import { RoleEnum } from '/@/enums/roleEnum';
-
 import { defineComponent } from 'vue';
 
 export type Component<T extends any = any> =
@@ -8,49 +7,6 @@ export type Component<T extends any = any> =
   | (() => Promise<typeof import('*.vue')>)
   | (() => Promise<T>);
 
-export interface RouteMeta {
-  // title
-  title: string;
-  // Whether to ignore permissions
-  ignoreAuth?: boolean;
-  // role info
-  roles?: RoleEnum[];
-  // Whether not to cache
-  ignoreKeepAlive?: boolean;
-  // Is it fixed on tab
-  affix?: boolean;
-  // icon on tab
-  icon?: string;
-
-  frameSrc?: string;
-
-  // current page transition
-  transitionName?: string;
-
-  // Whether the route has been dynamically added
-  hideBreadcrumb?: boolean;
-
-  // Hide submenu
-  hideChildrenInMenu?: boolean;
-
-  // Carrying parameters
-  carryParam?: boolean;
-
-  // Used internally to mark single-level menus
-  single?: boolean;
-
-  // Currently active menu
-  currentActiveMenu?: string;
-
-  // Never show in tab
-  hideTab?: boolean;
-
-  // Never show in menu
-  hideMenu?: boolean;
-
-  isLink?: boolean;
-}
-
 // @ts-ignore
 export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
   name: string;
@@ -61,6 +17,7 @@ export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
   props?: Recordable;
   fullPath?: string;
 }
+
 export interface MenuTag {
   type?: 'primary' | 'error' | 'warn' | 'success';
   content?: string;

+ 1 - 0
types/index.d.ts

@@ -11,6 +11,7 @@ declare type RefType<T> = T | null;
 declare type LabelValueOptions = {
   label: string;
   value: any;
+  [key: string]: string | number | boolean;
 }[];
 
 declare type EmitType = (event: string, ...args: any[]) => void;

+ 0 - 0
types/store.ts → types/store.d.ts


+ 0 - 0
types/utils.ts → types/utils.d.ts


+ 36 - 0
types/vue-router.d.ts

@@ -0,0 +1,36 @@
+export {};
+
+declare module 'vue-router' {
+  interface RouteMeta extends Record<string | number | symbol, unknown> {
+    // title
+    title: string;
+    // Whether to ignore permissions
+    ignoreAuth?: boolean;
+    // role info
+    roles?: RoleEnum[];
+    // Whether not to cache
+    ignoreKeepAlive?: boolean;
+    // Is it fixed on tab
+    affix?: boolean;
+    // icon on tab
+    icon?: string;
+    frameSrc?: string;
+    // current page transition
+    transitionName?: string;
+    // Whether the route has been dynamically added
+    hideBreadcrumb?: boolean;
+    // Hide submenu
+    hideChildrenInMenu?: boolean;
+    // Carrying parameters
+    carryParam?: boolean;
+    // Used internally to mark single-level menus
+    single?: boolean;
+    // Currently active menu
+    currentActiveMenu?: string;
+    // Never show in tab
+    hideTab?: boolean;
+    // Never show in menu
+    hideMenu?: boolean;
+    isLink?: boolean;
+  }
+}