mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
build(projects): 更新tsconfig.json
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { useRouter } from 'vue-router';
|
||||
import type { RouteLocationRaw } from 'vue-router';
|
||||
import { router as globalRouter, routeName } from '@/router';
|
||||
import { LoginModuleKey } from '@/interface';
|
||||
import type { LoginModuleKey } from '@/interface';
|
||||
|
||||
/**
|
||||
* 路由跳转
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {
|
||||
import type {
|
||||
EnumLayoutComponentName,
|
||||
EnumThemeLayoutMode,
|
||||
EnumThemeTabMode,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import BScroll from '@better-scroll/core';
|
||||
import type BScroll from '@better-scroll/core';
|
||||
|
||||
export interface ExposeBetterScroll {
|
||||
instance: BScroll;
|
||||
|
@ -1,4 +1,9 @@
|
||||
import { EnumThemeLayoutMode, EnumThemeTabMode, EnumThemeHorizontalMenuPosition, EnumThemeAnimateMode } from '@/enum';
|
||||
import type {
|
||||
EnumThemeLayoutMode,
|
||||
EnumThemeTabMode,
|
||||
EnumThemeHorizontalMenuPosition,
|
||||
EnumThemeAnimateMode
|
||||
} from '@/enum';
|
||||
import type { ThemeLayoutMode, ThemeTabMode, ThemeHorizontalMenuPosition, ThemeAnimateMode } from './enum';
|
||||
|
||||
/** 主题相关类型 */
|
||||
|
@ -18,7 +18,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import type { FollowerPlacement } from 'vueuc';
|
||||
import { EnumThemeLayoutMode } from '@/enum';
|
||||
import type { EnumThemeLayoutMode } from '@/enum';
|
||||
import type { ThemeLayoutMode } from '@/interface';
|
||||
|
||||
interface Props {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { getLoginModuleRegExp } from '@/utils';
|
||||
import { LoginModuleKey } from '@/interface';
|
||||
import type { LoginModuleKey } from '@/interface';
|
||||
|
||||
/** 固定的路由 */
|
||||
export const constantRoutes: AuthRoute.Route[] = [
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import type { FormItemRule } from 'naive-ui';
|
||||
import { REGEXP_PHONE, REGEXP_PWD, REGEXP_CODE_SIX, REGEXP_EMAIL } from '@/config';
|
||||
|
||||
|
@ -5,12 +5,17 @@ type ViewComponent = Record<string, () => Promise<Component>>;
|
||||
const importViews = import.meta.glob('./**/index.vue');
|
||||
|
||||
const COMPONENTS_KEY = 'components';
|
||||
const PREFIX = './';
|
||||
const SUFFIX = '/index.vue';
|
||||
|
||||
/**
|
||||
* 路径正则匹配
|
||||
* 1 './' => ''
|
||||
* 2 '/index.vue' => ''
|
||||
* 3 'system-view_' => '' (系统的内置路由,该文件夹名称不作为RouteKey)
|
||||
*/
|
||||
const KEY_REGEXP = /\.\/|\/index\.vue|system-view_/g;
|
||||
|
||||
const PATH_SPLIT_MARK = '/';
|
||||
const ROUTE_KEY_SPLIT_MARK = '_';
|
||||
/** 系统的内置路由,该文件夹名称不作为RouteKey */
|
||||
const SYSTEM_VIEW = 'system-view_';
|
||||
|
||||
/** 过滤掉组件文件 */
|
||||
const viewKeys = Object.keys(importViews).filter(key => !key.includes(COMPONENTS_KEY));
|
||||
@ -18,11 +23,8 @@ const viewKeys = Object.keys(importViews).filter(key => !key.includes(COMPONENTS
|
||||
function getViewComponent() {
|
||||
const components: ViewComponent = {};
|
||||
viewKeys.forEach(key => {
|
||||
const routeKey = key
|
||||
.replace(PREFIX, '')
|
||||
.replace(SUFFIX, '')
|
||||
.replaceAll(PATH_SPLIT_MARK, ROUTE_KEY_SPLIT_MARK)
|
||||
.replace(SYSTEM_VIEW, '');
|
||||
const routeKey = key.replace(KEY_REGEXP, '').replace(new RegExp(PATH_SPLIT_MARK, 'g'), ROUTE_KEY_SPLIT_MARK);
|
||||
|
||||
components[routeKey] = importViews[key];
|
||||
});
|
||||
return components;
|
||||
|
Reference in New Issue
Block a user