From 39a7411df53ce35e2fbf62c8a91d13ca2624f0b7 Mon Sep 17 00:00:00 2001
From: Soybean <2570172956@qq.com>
Date: Mon, 13 Sep 2021 18:43:00 +0800
Subject: [PATCH] =?UTF-8?q?docs(projects):=20=E6=9B=B4=E6=96=B0README.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 22 +++++-----------------
src/interface/common.ts | 6 ++++++
src/interface/index.ts | 2 +-
src/router/index.ts | 3 ++-
4 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/README.md b/README.md
index 9baa5a0e..2b94e49f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
+
@@ -9,6 +9,7 @@
+
## 简介
Soybean Admin 是一个基于 Vue3、Vite、Naive UI、TypeScript 的中后台解决方案,它使用了最新的前端技术栈,并提炼了典型的业务模型,页面,包括二次封装组件、动态菜单、权限校验、粒子化权限控制等功能,它可以帮助你快速搭建企业级中后台项目,相信不管是从新技术使用还是其他方面,都能帮助到你。
@@ -32,7 +33,6 @@ soybean-admin
├── README.md //项目说明文档
├── build //vite构建相关配置和插件
│ ├── env //.env环境文件内容加载插件
-│ ├── index.ts
│ └── plugins //构建插件
│ ├── html.ts //html插件(注入变量,压缩代码等)
│ ├── iconify.ts //iconify图标插件
@@ -47,59 +47,47 @@ soybean-admin
│ ├── App.vue //vue文件入口
│ ├── AppProvider.vue //配置naive UI的vue文件(国际化,loadingBar、message等组件)
│ ├── assets //静态资源
-│ │ └── img
│ ├── components //全局组件
│ │ ├── business //业务相关组件
│ │ ├── common //公共组件
-│ │ ├── custom //自定义组件
-│ │ └── index.ts
+│ │ └── custom //自定义组件
│ ├── enum //TS枚举
│ │ ├── animate.ts //动画枚举
│ │ ├── business.ts //业务相关枚举
│ │ ├── common.ts //通用枚举
-│ │ ├── index.ts
│ │ ├── route.ts //路由相关枚举
│ │ └── theme.ts //系统主题配置相关枚举
│ ├── hooks //组合式的钩子函数hooks
│ │ ├── business //业务相关hooks
-│ │ ├── common //通用hooks
-│ │ └── index.ts
+│ │ └── common //通用hooks
│ ├── interface //TS类型接口
│ │ ├── business.ts //业务相关类型接口
│ │ ├── common.ts //通用类型接口
-│ │ ├── index.ts
│ │ └── theme.ts //系统主题配置相关类型接口
│ ├── layouts //布局组件
│ │ ├── BasicLayout //基本布局组件(包含全局头部、侧边栏、底部等)
-│ │ ├── BlankLayout //空白布局组件
-│ │ └── index.ts
+│ │ └── BlankLayout //空白布局组件
│ ├── main.ts //项目入口ts文件
│ ├── plugins //插件
│ │ ├── dark-mode.ts //windicss暗黑模式插件
-│ │ ├── index.ts
│ │ └── smooth-scroll.ts //滚动平滑插件
│ ├── router //vue路由
-│ │ ├── index.ts
│ │ ├── permission.ts //路由守卫相关函数
│ │ └── routes.ts //声明的路由
│ ├── service //网络请求
│ │ ├── api //请求接口
-│ │ ├── index.ts
│ │ ├── middleware //请求结果的处理中间件
│ │ ├── request //封装的请求函数
│ │ └── utils //请求相关工具函数
│ ├── settings //项目初始配置
-│ │ ├── index.ts
│ │ └── theme.ts //项目主题初始配置
│ ├── store //状态管理
-│ │ ├── index.ts
│ │ └── modules //状态管理划分的模块
│ ├── styles //样式
│ ├── types //TS类型声明文件(*.d.ts)
│ ├── utils //全局工具函数
│ │ ├── auth
│ │ ├── common
-│ │ ├── index.ts
│ │ └── storage
│ └── views //页面
│ ├── dashboard
diff --git a/src/interface/common.ts b/src/interface/common.ts
index d4649b6b..b23770da 100644
--- a/src/interface/common.ts
+++ b/src/interface/common.ts
@@ -1,4 +1,10 @@
import { EnumRoutePaths, EnumLoginModule } from '@/enum';
+/** 路由描述 */
+export interface RouteMeta {
+ /** 页面100%视高 */
+ fullPage?: boolean;
+}
+
export type RoutePathKey = keyof typeof EnumRoutePaths;
export type LoginModuleType = keyof typeof EnumLoginModule;
diff --git a/src/interface/index.ts b/src/interface/index.ts
index 626ff1b6..62132910 100644
--- a/src/interface/index.ts
+++ b/src/interface/index.ts
@@ -1,3 +1,3 @@
export { UserInfo } from './business';
export { ThemeSettings, NavMode, AnimateType } from './theme';
-export { RoutePathKey, LoginModuleType } from './common';
+export { RouteMeta, RoutePathKey, LoginModuleType } from './common';
diff --git a/src/router/index.ts b/src/router/index.ts
index f5cb71b2..4806f4ea 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -11,7 +11,8 @@ const isVercel = import.meta.env.VITE_HTTP_ENV === 'VERCEL';
const router = createRouter({
history: isVercel ? createWebHashHistory() : createWebHistory(),
- routes
+ routes,
+ scrollBehavior: () => ({ left: 0, top: 0 })
});
export async function setupRouter(app: App) {