config.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. text: 'useCrudSchemas',
  99. link: '/hooks/useCrudSchemas',
  100. },
  101. ],
  102. },
  103. {
  104. text: '相关链接',
  105. items: [
  106. {
  107. text: 'Github 站点预览',
  108. link: 'https://element-plus-admin.cn/',
  109. },
  110. {
  111. text: 'Github 源码',
  112. link: 'https://github.com/kailong321200875/vue-element-plus-admin',
  113. },
  114. {
  115. text: 'Github 文档源码',
  116. link: 'https://github.com/kailong321200875/vue-element-plus-admin-doc',
  117. },
  118. {
  119. text: 'Github 更新日志',
  120. link: 'https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.md',
  121. },
  122. {
  123. text: 'Gitee 站点预览',
  124. link: 'https://kailong110120130.gitee.io/vue-element-plus-admin',
  125. },
  126. {
  127. text: 'Gitee 源码',
  128. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin',
  129. },
  130. {
  131. text: 'Gitee 文档源码',
  132. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin-doc',
  133. },
  134. {
  135. text: 'Gitee 更新日志',
  136. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin/blob/master/CHANGELOG.md',
  137. },
  138. ],
  139. },
  140. ];
  141. }
  142. function createSidebar() {
  143. return {
  144. '/hooks/': [
  145. {
  146. text: 'useWatermark',
  147. link: '/hooks/useWatermark',
  148. },
  149. {
  150. text: 'useCrudSchemas',
  151. link: '/hooks/useCrudSchemas',
  152. },
  153. ],
  154. '/components/': [
  155. {
  156. text: '组件',
  157. children: [
  158. {
  159. text: '前言',
  160. link: '/components/introduction',
  161. },
  162. ],
  163. },
  164. {
  165. text: '全局组件',
  166. children: [
  167. {
  168. text: 'Icon 图标组件',
  169. link: '/components/icon',
  170. },
  171. ],
  172. },
  173. {
  174. text: '功能组件',
  175. children: [
  176. {
  177. text: 'Form 表单组件',
  178. link: '/components/form',
  179. },
  180. {
  181. text: 'Table 表格组件',
  182. link: '/components/table',
  183. },
  184. {
  185. text: 'Editor 富文本组件',
  186. link: '/components/editor',
  187. },
  188. {
  189. text: 'Search 查询组件',
  190. link: '/components/search',
  191. },
  192. {
  193. text: 'Descriptions 描述组件',
  194. link: '/components/descriptions',
  195. },
  196. {
  197. text: 'Dialog 弹窗组件',
  198. link: '/components/dialog',
  199. },
  200. {
  201. text: 'Echart 图表组件',
  202. link: '/components/echart',
  203. },
  204. {
  205. text: 'CountTo 数字动画组件',
  206. link: '/components/count-to',
  207. },
  208. {
  209. text: 'Qrcode 二维码组件',
  210. link: '/components/qrcode',
  211. },
  212. {
  213. text: 'Highlight 高亮组件',
  214. link: '/components/highlight',
  215. },
  216. {
  217. text: 'Infotip 信息提示组件',
  218. link: '/components/infotip',
  219. },
  220. {
  221. text: 'Error 缺省组件',
  222. link: '/components/error',
  223. },
  224. {
  225. text: 'Sticky 黏性组件',
  226. link: '/components/sticky',
  227. },
  228. {
  229. text: 'ContentDetailWrap 详情包裹组件',
  230. link: '/components/content-detail-wrap',
  231. },
  232. {
  233. text: 'InputPassword 密码输入框组件',
  234. link: '/components/input-password',
  235. },
  236. {
  237. text: 'Footer 页脚组件',
  238. link: '/components/footer',
  239. },
  240. ],
  241. },
  242. {
  243. text: '函数式组件',
  244. children: [
  245. {
  246. text: 'ImageViewer 图片预览组件',
  247. link: '/components/image-viewer',
  248. },
  249. ],
  250. },
  251. ],
  252. '/': [
  253. {
  254. text: '指南',
  255. children: [
  256. {
  257. text: '介绍',
  258. link: '/guide/introduction',
  259. },
  260. {
  261. text: '开始',
  262. link: '/guide/',
  263. },
  264. {
  265. text: '项目配置',
  266. link: '/guide/settings',
  267. },
  268. {
  269. text: '路由',
  270. link: '/guide/router',
  271. },
  272. {
  273. text: '权限',
  274. link: '/guide/auth',
  275. },
  276. {
  277. text: 'Mock&联调',
  278. link: '/guide/mock',
  279. },
  280. {
  281. text: '组件注册',
  282. link: '/guide/component',
  283. },
  284. {
  285. text: '样式',
  286. link: '/guide/design',
  287. },
  288. {
  289. text: '构建&部署',
  290. link: '/guide/deploy',
  291. },
  292. ],
  293. },
  294. {
  295. text: '深入',
  296. children: [
  297. {
  298. text: '国际化',
  299. link: '/dep/i18n',
  300. },
  301. {
  302. text: '项目规范',
  303. link: '/dep/lint',
  304. },
  305. {
  306. text: '黑暗主题',
  307. link: '/dep/dark',
  308. },
  309. {
  310. text: '模版生成',
  311. link: '/dep/create-module',
  312. },
  313. ],
  314. },
  315. ],
  316. };
  317. }