config.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. // @ts-check
  2. /**
  3. * @type {import('vitepress').UserConfig}
  4. */
  5. module.exports = {
  6. base: (process.argv[3] && process.argv[3] === '--gitee') ? '/vue-element-plus-admin-doc/' : '/',
  7. title: 'vue-element-plus-admin',
  8. lang: 'zh-CN',
  9. description: '一套基于vue3、element-plus、typesScript4、vite2的后台集成方案',
  10. head: createHead(),
  11. themeConfig: {
  12. repo: 'kailong321200875/vue-element-plus-adminc',
  13. docsRepo: 'kailong321200875/vue-element-plus-admin-doc',
  14. logo: '/logo.png',
  15. docsBranch: 'master',
  16. editLinks: true,
  17. editLinkText: '为此页提供修改建议',
  18. nav: createNav(),
  19. sidebar: createSidebar(),
  20. },
  21. };
  22. /**
  23. * @type {()=>import('vitepress').HeadConfig[]}
  24. */
  25. function createHead() {
  26. return [
  27. ['meta', { name: 'author', content: 'Archer' }],
  28. [
  29. 'meta',
  30. {
  31. name: 'keywords',
  32. content: 'vue-element-plus-admin, vitejs, vite, element-plus, vue',
  33. },
  34. ],
  35. ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
  36. [
  37. 'meta',
  38. {
  39. name: 'viewport',
  40. content:
  41. 'width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no',
  42. },
  43. ],
  44. ['meta', { name: 'keywords', content: 'vue-element-plus-admin-doc' }],
  45. ['link', { rel: 'icon', href: '/favicon.ico' }],
  46. ];
  47. }
  48. /**
  49. * @type {()=>import('./theme-default/config').DefaultTheme.NavItem[]}
  50. */
  51. function createNav() {
  52. return [
  53. {
  54. text: '指南',
  55. link: '/guide/',
  56. items: [
  57. {
  58. text: '指南',
  59. link: '/guide/introduction',
  60. },
  61. {
  62. text: '深入',
  63. link: '/dep/i18n',
  64. },
  65. ],
  66. },
  67. {
  68. text: '组件',
  69. link: '/components/',
  70. items: [
  71. {
  72. text: '介绍',
  73. link: '/components/introduction',
  74. },
  75. {
  76. text: '全局组件',
  77. link: '/components/icon',
  78. },
  79. {
  80. text: '功能组件',
  81. link: '/components/form',
  82. },
  83. {
  84. text: '函数式组件',
  85. link: '/components/image-viewer',
  86. },
  87. ],
  88. },
  89. {
  90. text: '常用Hooks',
  91. link: '/hooks/',
  92. items: [
  93. {
  94. text: 'useWatermark',
  95. link: '/hooks/useWatermark',
  96. },
  97. ],
  98. },
  99. {
  100. text: '相关链接',
  101. items: [
  102. {
  103. text: 'Github 站点预览',
  104. link: 'https://element-plus-admin.cn/',
  105. },
  106. {
  107. text: 'Github 源码',
  108. link: 'https://github.com/kailong321200875/vue-element-plus-admin',
  109. },
  110. {
  111. text: 'Github 文档源码',
  112. link: 'https://github.com/kailong321200875/vue-element-plus-admin-doc',
  113. },
  114. {
  115. text: 'Github 更新日志',
  116. link: 'https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.md',
  117. },
  118. {
  119. text: 'Gitee 站点预览',
  120. link: 'https://kailong110120130.gitee.io/vue-element-plus-admin',
  121. },
  122. {
  123. text: 'Gitee 源码',
  124. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin',
  125. },
  126. {
  127. text: 'Gitee 文档源码',
  128. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin-doc',
  129. },
  130. {
  131. text: 'Gitee 更新日志',
  132. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin/blob/master/CHANGELOG.md',
  133. },
  134. ],
  135. },
  136. ];
  137. }
  138. function createSidebar() {
  139. return {
  140. '/hooks/': [
  141. {
  142. text: 'useWatermark',
  143. link: '/hooks/useWatermark',
  144. },
  145. ],
  146. '/components/': [
  147. {
  148. text: '组件',
  149. children: [
  150. {
  151. text: '前言',
  152. link: '/components/introduction',
  153. },
  154. ],
  155. },
  156. {
  157. text: '全局组件',
  158. children: [
  159. {
  160. text: 'Icon 图标组件',
  161. link: '/components/icon',
  162. },
  163. ],
  164. },
  165. {
  166. text: '功能组件',
  167. children: [
  168. {
  169. text: 'Form 表单组件',
  170. link: '/components/form',
  171. },
  172. {
  173. text: 'Table 表格组件',
  174. link: '/components/table',
  175. },
  176. {
  177. text: 'Editor 富文本组件',
  178. link: '/components/editor',
  179. },
  180. {
  181. text: 'Search 查询组件',
  182. link: '/components/search',
  183. },
  184. {
  185. text: 'Descriptions 描述组件',
  186. link: '/components/descriptions',
  187. },
  188. {
  189. text: 'Dialog 弹窗组件',
  190. link: '/components/dialog',
  191. },
  192. {
  193. text: 'Echart 图表组件',
  194. link: '/components/echart',
  195. },
  196. {
  197. text: 'CountTo 数字动画组件',
  198. link: '/components/count-to',
  199. },
  200. {
  201. text: 'Qrcode 二维码组件',
  202. link: '/components/qrcode',
  203. },
  204. {
  205. text: 'Highlight 高亮组件',
  206. link: '/components/highlight',
  207. },
  208. {
  209. text: 'Infotip 信息提示组件',
  210. link: '/components/infotip',
  211. },
  212. {
  213. text: 'Error 缺省组件',
  214. link: '/components/error',
  215. },
  216. ],
  217. },
  218. {
  219. text: '函数式组件',
  220. children: [
  221. {
  222. text: 'ImageViewer 图片预览组件',
  223. link: '/components/image-viewer',
  224. },
  225. ],
  226. },
  227. ],
  228. '/': [
  229. {
  230. text: '指南',
  231. children: [
  232. {
  233. text: '介绍',
  234. link: '/guide/introduction',
  235. },
  236. {
  237. text: '开始',
  238. link: '/guide/',
  239. },
  240. {
  241. text: '项目配置',
  242. link: '/guide/settings',
  243. },
  244. {
  245. text: '路由',
  246. link: '/guide/router',
  247. },
  248. {
  249. text: '权限',
  250. link: '/guide/auth',
  251. },
  252. {
  253. text: 'Mock&联调',
  254. link: '/guide/mock',
  255. },
  256. {
  257. text: '组件注册',
  258. link: '/guide/component',
  259. },
  260. {
  261. text: '样式',
  262. link: '/guide/design',
  263. },
  264. {
  265. text: '构建&部署',
  266. link: '/guide/deploy',
  267. },
  268. ],
  269. },
  270. {
  271. text: '深入',
  272. children: [
  273. {
  274. text: '国际化',
  275. link: '/dep/i18n',
  276. },
  277. {
  278. text: '项目规范',
  279. link: '/dep/lint',
  280. },
  281. {
  282. text: '黑暗主题',
  283. link: '/dep/dark',
  284. },
  285. ],
  286. },
  287. ],
  288. };
  289. }