Browse Source

docs: 修改文档

kailong321200875 2 years ago
parent
commit
3a97fb6ad7
3 changed files with 10 additions and 4 deletions
  1. 1 1
      .vitepress/config.js
  2. 8 2
      guide/auth.md
  3. 1 1
      guide/introduction.md

+ 1 - 1
.vitepress/config.js

@@ -6,7 +6,7 @@ module.exports = {
   base: process.argv[3] && process.argv[3] === '--gitee' ? '/vue-element-plus-admin-doc/' : '/',
   title: 'vue-element-plus-admin',
   lang: 'zh-CN',
-  description: '一套基于vue3、element-plus、typesScript4、vite2的后台集成方案',
+  description: '一套基于vue3、element-plus、typesScript4、vite3的后台集成方案',
   head: createHead(),
   themeConfig: {
     repo: 'kailong321200875/vue-element-plus-adminc',

+ 8 - 2
guide/auth.md

@@ -183,12 +183,12 @@ const getRole = async () => {
     const { wsCache } = useCache()
     const routers = res.data.list || []
     wsCache.set('roleRouters', routers)
-    
+
     // 不管最终要使用什么方式进行权限过滤,都需要调用 permissionStore.generateRoutes()
     formData.username === 'admin'
       ? await permissionStore.generateRoutes('admin', routers).catch(() => {})
       : await permissionStore.generateRoutes('test', routers).catch(() => {})
-    
+
     // 过滤完路由之后,需要动态注册路由
     permissionStore.getAddRouters.forEach((route) => {
       addRoute(route as RouteRecordRaw) // 动态添加可访问路由表
@@ -219,3 +219,9 @@ const nextData = to.path === redirect ? { ...to, replace: true } : { path: redir
 permissionStore.setIsAddRouters(true)
 next(nextData)
 ```
+
+## 静态路由(无权限)
+
+有时候,我们并不需要动态路由,那么可以在 `src/config/app.ts` 中把 `dynamicRouter` 设置为 `false`,这样我们取得都是项目中的静态路由表了。
+
+内部逻辑已经处理了静态路由的部分,所以可以无需关心其他。

+ 1 - 1
guide/introduction.md

@@ -2,7 +2,7 @@
 
 ## 简介
 
-[vue-element-plus-admin](https://github.com/kailong321200875/vue-element-plus-admin) 是一个基于 [element-plus](https://element-plus.org/) 免费开源的中后台模版。使用了最新的 [Vue3](https://github.com/vuejs/vue-next),[Vite2](https://github.com/vitejs/vite),[Typescript](https://www.typescriptlang.org/)等主流技术开发,开箱即用的中后台前端解决方案,可以用来作为项目的启动模版,也可用于学习参考。并且时刻关注着最新技术动向,尽可能的第一时间更新。
+[vue-element-plus-admin](https://github.com/kailong321200875/vue-element-plus-admin) 是一个基于 [element-plus](https://element-plus.org/) 免费开源的中后台模版。使用了最新的 [Vue3](https://github.com/vuejs/vue-next),[Vite3](https://github.com/vitejs/vite),[Typescript](https://www.typescriptlang.org/)等主流技术开发,开箱即用的中后台前端解决方案,可以用来作为项目的启动模版,也可用于学习参考。并且时刻关注着最新技术动向,尽可能的第一时间更新。
 
 [vue-element-plus-admin](https://github.com/kailong321200875/vue-element-plus-admin) 的定位是后台集成方案,不太适合当基础模板来进行二次开发。因为集成了很多你可能用不到的功能,会造成不少的代码冗余。如果你的项目不关注这方面的问题,也可以直接基于它进行二次开发。