您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

3 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # 简介
  2. DUI 一个基于 Vue3、Vue-router、 Vite、 TypeScript、 Elment-UI-Plus 的前端框架。
  3. ## 相关说明
  4. | | 相关地址 |
  5. | :------------: | :------------------------------------------------: |
  6. | Vue3 | https://vue3js.cn/ |
  7. | Vue-router | https://router.vuejs.org/zh/ |
  8. | Vite | https://vitejs.cn/ |
  9. | TypeScript | https://www.runoob.com/typescript/ts-tutorial.html |
  10. | Elment-UI-Plus | https://element-plus.gitee.io/zh-CN/ |
  11. ## 项目源码
  12. | | 前端源码 |
  13. | :---: | :---------------------------------: |
  14. | GitEE | https://gitee.com/dmc_qq/VueWeb.git |
  15. # 目录结构
  16. ```
  17. |-- src
  18. |-- App.vue //根组件
  19. |-- main.ts //入口ts文件
  20. |-- shims-vue.d.ts //typescript的适配定义文件
  21. |-- vite-env.d.ts //vite配置文件
  22. |-- api //接口文件
  23. |-- assets //资源目录
  24. | |-- image //图片
  25. | |-- ioc //图标
  26. | |-- style //样式
  27. | |-- video //视频
  28. |-- components //组件目录
  29. |-- data //自定义data数据
  30. |-- layout //主页面布局
  31. | |-- index.vue //主页面
  32. | |-- components
  33. | |-- Head.vue //头部
  34. | |-- Item.vue //图标
  35. | |-- SidebarItem.vue //菜单栏
  36. | |-- TabControl.vue //选项卡
  37. |-- router //页面路由
  38. | |-- index.ts
  39. |-- store //vuex全局配置
  40. | |-- index.js
  41. | |-- tabValue.js
  42. |-- style //全局样式
  43. | |-- main.css
  44. |-- utils //工具类
  45. | |-- cookie.js
  46. |-- views //页面视图
  47. |-- home
  48. | |-- Home.vue
  49. |-- home1
  50. | |-- index.vue
  51. |-- home2
  52. | |-- index.vue
  53. |-- login
  54. | |-- Login.vue
  55. |-- menu
  56. |-- index.vue
  57. ```
  58. # 快速预览
  59. ## 所需环境
  60. ```
  61. Node v10+ (最好使用 12,高版本可能会有问题)
  62. 安装教程:https://www.runoob.com/nodejs/nodejs-install-setup.html
  63. ```
  64. ## 设置淘宝的镜像源
  65. ```text
  66. npm config set registry https://registry.npm.taobao.org
  67. 配置后可通过下面方式来验证是否成功
  68. npm config get registry
  69. ```
  70. ## 运行
  71. ```tex
  72. npm install //下载依赖
  73. npm run dev //运行程序
  74. ```
  75. ## 其他
  76. ### cnpm
  77. ```text
  78. npm install -g cnpm --registry=https://registry.npm.taobao.org
  79. ```
  80. ### npm常用指令
  81. | 更新淘宝镜像 | cnpm i @vue/cli -g |
  82. | :----------: | :---------------------: |
  83. | 更新npm | npm i npm -g |
  84. | 清空缓存 | npm cache clear --force |
  85. #菜单路由
  86. ## 菜单路由
  87. 通过用户的角色返回相应的菜单路由,前端关键代码: `src/router/index.ts`
  88. ## 菜单格式
  89. ```js
  90. {
  91. path: '/layout/index',
  92. name: 'Layout',
  93. component: () => import('@/layout/index.vue'),
  94. redirect: '/views/home',
  95. children: [ //展开层级
  96. {
  97. path: '/views/home', //页面路由
  98. name: 'Home', //页面名称
  99. meta: { title: '主页', isAuth: true }, //用户自定内容
  100. components: {
  101. key: () => import('@/views/home/Home.vue'), //指定文件
  102. },
  103. },
  104. ],
  105. }
  106. ```