config.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. // @ts-check
  2. /**
  3. * @type {import('vitepress').UserConfig}
  4. */
  5. module.exports = {
  6. base: '/',
  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: 'main',
  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. },
  81. {
  82. text: '相关链接',
  83. items: [
  84. {
  85. text: '完整版预览',
  86. link: 'https://element-plus-admin.cn/',
  87. },
  88. {
  89. text: '完整版源码',
  90. link: 'https://github.com/kailong321200875/vue-element-plus-admin',
  91. },
  92. {
  93. text: '文档源码',
  94. link: 'https://github.com/kailong321200875/vue-element-plus-admin-doc',
  95. },
  96. {
  97. text: '更新日志',
  98. link: 'https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.zh_CN.md',
  99. },
  100. ],
  101. },
  102. ];
  103. }
  104. function createSidebar() {
  105. return {
  106. '/components/': [
  107. {
  108. text: '组件',
  109. children: [
  110. {
  111. text: '前言',
  112. link: '/components/introduction',
  113. },
  114. ],
  115. },
  116. {
  117. text: '全局组件',
  118. children: [
  119. {
  120. text: 'Icon 图标组件',
  121. link: '/components/icon',
  122. },
  123. ],
  124. },
  125. {
  126. text: '常用组件',
  127. children: [
  128. {
  129. text: 'Form 表单组件',
  130. link: '/components/form',
  131. },
  132. ],
  133. },
  134. ],
  135. '/': [
  136. {
  137. text: '指南',
  138. children: [
  139. {
  140. text: '介绍',
  141. link: '/guide/introduction',
  142. },
  143. {
  144. text: '开始',
  145. link: '/guide/',
  146. },
  147. {
  148. text: '项目配置',
  149. link: '/guide/settings',
  150. },
  151. {
  152. text: '路由',
  153. link: '/guide/router',
  154. },
  155. {
  156. text: '权限',
  157. link: '/guide/auth',
  158. },
  159. {
  160. text: 'Mock&联调',
  161. link: '/guide/mock',
  162. },
  163. {
  164. text: '组件注册',
  165. link: '/guide/component',
  166. },
  167. {
  168. text: '样式',
  169. link: '/guide/design',
  170. },
  171. {
  172. text: '构建&部署',
  173. link: '/guide/deploy',
  174. },
  175. ],
  176. },
  177. {
  178. text: '深入',
  179. children: [
  180. {
  181. text: '国际化',
  182. link: '/dep/i18n',
  183. },
  184. {
  185. text: '项目规范',
  186. link: '/dep/lint',
  187. },
  188. {
  189. text: '黑暗主题',
  190. link: '/dep/dark',
  191. },
  192. ],
  193. },
  194. ],
  195. };
  196. }
  197. // /**
  198. // * @type {(namespace:string,items:string[])=>string[]}
  199. // */
  200. // function urlWrapper(namespace, items) {
  201. // return items.map((item) => namespace + item);
  202. // }
  203. // function getGuildNav() {
  204. // return urlWrapper('/guide', ['/']);
  205. // }