config.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. // @ts-check
  2. // const { docsearchPlugin } = require('@vuepress/plugin-docsearch');
  3. /**
  4. * @type {import('vitepress').UserConfig}
  5. */
  6. module.exports = {
  7. base: process.argv[3] && process.argv[3] === '--gitee' ? '/vue-element-plus-admin-doc/' : '/',
  8. title: 'vue-element-plus-admin',
  9. lang: 'zh-CN',
  10. description: '一套基于vue3、element-plus、typesScript、vite的后台集成方案',
  11. head: createHead(),
  12. // plugins: [docsearchPlugin({})],
  13. themeConfig: {
  14. repo: 'kailong321200875/vue-element-plus-adminc',
  15. docsRepo: 'kailong321200875/vue-element-plus-admin-doc',
  16. logo: '/logo.png',
  17. docsBranch: 'master',
  18. editLinks: true,
  19. editLinkText: '为此页提供修改建议',
  20. nav: createNav(),
  21. sidebar: createSidebar(),
  22. },
  23. };
  24. /**
  25. * @type {()=>import('vitepress').HeadConfig[]}
  26. */
  27. function createHead() {
  28. return [
  29. ['meta', { name: 'author', content: 'Archer' }],
  30. [
  31. 'meta',
  32. {
  33. name: 'keywords',
  34. content: 'vue-element-plus-admin, vitejs, vite, element-plus, vue',
  35. },
  36. ],
  37. ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
  38. [
  39. 'meta',
  40. {
  41. name: 'viewport',
  42. content:
  43. 'width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no',
  44. },
  45. ],
  46. ['meta', { name: 'keywords', content: 'vue-element-plus-admin-doc' }],
  47. ['link', { rel: 'icon', href: '/favicon.ico' }],
  48. ];
  49. }
  50. /**
  51. * @type {()=>import('./theme-default/config').DefaultTheme.NavItem[]}
  52. */
  53. function createNav() {
  54. return [
  55. {
  56. text: '指南',
  57. link: '/guide/',
  58. items: [
  59. {
  60. text: '指南',
  61. link: '/guide/introduction',
  62. },
  63. {
  64. text: '深入',
  65. link: '/dep/i18n',
  66. },
  67. {
  68. text: 'v2版本重大更新',
  69. link: '/guide/version',
  70. },
  71. ],
  72. },
  73. {
  74. text: '组件',
  75. link: '/components/',
  76. items: [
  77. {
  78. text: '介绍',
  79. link: '/components/introduction',
  80. },
  81. {
  82. text: '全局组件',
  83. link: '/components/icon',
  84. },
  85. {
  86. text: '功能组件',
  87. link: '/components/form',
  88. },
  89. {
  90. text: '函数式组件',
  91. link: '/components/image-viewer',
  92. },
  93. ],
  94. },
  95. {
  96. text: '常用Hooks',
  97. link: '/hooks/',
  98. items: [
  99. {
  100. text: 'useWatermark',
  101. link: '/hooks/useWatermark',
  102. },
  103. {
  104. text: 'useCrudSchemas',
  105. link: '/hooks/useCrudSchemas',
  106. },
  107. {
  108. text: 'useTagsView(2.1.0+)',
  109. link: '/hooks/useTagsView',
  110. },
  111. {
  112. text: 'useStorage(2.1.0+)',
  113. link: '/hooks/useStorage',
  114. },
  115. {
  116. text: 'useClipboard(2.4.0+)',
  117. link: '/hooks/useClipboard',
  118. },
  119. {
  120. text: 'useNetwork(2.4.0+)',
  121. link: '/hooks/useNetwork',
  122. },
  123. ],
  124. },
  125. {
  126. text: '相关链接',
  127. items: [
  128. {
  129. text: 'Github 站点预览',
  130. link: 'https://element-plus-admin.cn/',
  131. },
  132. {
  133. text: 'Github 源码',
  134. link: 'https://github.com/kailong321200875/vue-element-plus-admin',
  135. },
  136. {
  137. text: 'Github 文档源码',
  138. link: 'https://github.com/kailong321200875/vue-element-plus-admin-doc',
  139. },
  140. {
  141. text: 'Github 更新日志',
  142. link: 'https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.md',
  143. },
  144. {
  145. text: 'Gitee 站点预览',
  146. link: 'https://kailong110120130.gitee.io/vue-element-plus-admin',
  147. },
  148. {
  149. text: 'Gitee 源码',
  150. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin',
  151. },
  152. {
  153. text: 'Gitee 文档源码',
  154. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin-doc',
  155. },
  156. {
  157. text: 'Gitee 更新日志',
  158. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin/blob/master/CHANGELOG.md',
  159. },
  160. ],
  161. },
  162. {
  163. text: '交流群',
  164. link: '/group/',
  165. items: [
  166. {
  167. text: '技术交流群',
  168. link: '/group/group',
  169. },
  170. ],
  171. },
  172. {
  173. text: '捐赠',
  174. link: '/donate/',
  175. items: [
  176. {
  177. text: '捐赠',
  178. link: '/donate/donate',
  179. },
  180. ],
  181. },
  182. ];
  183. }
  184. function createSidebar() {
  185. return {
  186. '/group/': [
  187. {
  188. text: '技术交流群',
  189. link: '/group/group',
  190. },
  191. ],
  192. '/donate/': [
  193. {
  194. text: '捐赠',
  195. link: '/donate/donate',
  196. },
  197. ],
  198. '/hooks/': [
  199. {
  200. text: 'useWatermark',
  201. link: '/hooks/useWatermark',
  202. },
  203. {
  204. text: 'useCrudSchemas',
  205. link: '/hooks/useCrudSchemas',
  206. },
  207. {
  208. text: 'useTagsView(2.1.0+)',
  209. link: '/hooks/useTagsView',
  210. },
  211. {
  212. text: 'useStorage(2.1.0+)',
  213. link: '/hooks/useStorage',
  214. },
  215. {
  216. text: 'useClipboard(2.4.0+)',
  217. link: '/hooks/useClipboard',
  218. },
  219. {
  220. text: 'useNetwork(2.4.0+)',
  221. link: '/hooks/useNetwork',
  222. },
  223. ],
  224. '/components/': [
  225. {
  226. text: '组件',
  227. children: [
  228. {
  229. text: '前言',
  230. link: '/components/introduction',
  231. },
  232. ],
  233. },
  234. {
  235. text: '全局组件',
  236. children: [
  237. {
  238. text: 'Icon 图标组件',
  239. link: '/components/icon',
  240. },
  241. {
  242. text: 'Permission 权限组件(2.1.0+)',
  243. link: '/components/permission',
  244. },
  245. ],
  246. },
  247. {
  248. text: '功能组件',
  249. children: [
  250. {
  251. text: 'Form 表单组件',
  252. link: '/components/form',
  253. },
  254. {
  255. text: 'Table 表格组件',
  256. link: '/components/table',
  257. },
  258. {
  259. text: 'Editor 富文本组件',
  260. link: '/components/editor',
  261. },
  262. {
  263. text: 'Search 查询组件',
  264. link: '/components/search',
  265. },
  266. {
  267. text: 'Descriptions 描述组件',
  268. link: '/components/descriptions',
  269. },
  270. {
  271. text: 'Dialog 弹窗组件',
  272. link: '/components/dialog',
  273. },
  274. {
  275. text: 'Echart 图表组件',
  276. link: '/components/echart',
  277. },
  278. {
  279. text: 'CountTo 数字动画组件',
  280. link: '/components/count-to',
  281. },
  282. {
  283. text: 'Qrcode 二维码组件',
  284. link: '/components/qrcode',
  285. },
  286. {
  287. text: 'Highlight 高亮组件',
  288. link: '/components/highlight',
  289. },
  290. {
  291. text: 'Infotip 信息提示组件',
  292. link: '/components/infotip',
  293. },
  294. {
  295. text: 'Error 缺省组件',
  296. link: '/components/error',
  297. },
  298. {
  299. text: 'Sticky 黏性组件',
  300. link: '/components/sticky',
  301. },
  302. {
  303. text: 'ContentDetailWrap 详情包裹组件',
  304. link: '/components/content-detail-wrap',
  305. },
  306. {
  307. text: 'InputPassword 密码输入框组件',
  308. link: '/components/input-password',
  309. },
  310. {
  311. text: 'Footer 页脚组件',
  312. link: '/components/footer',
  313. },
  314. {
  315. text: 'JsonEditor JSON编辑器组件(2.2.0+)',
  316. link: '/components/json-editor',
  317. },
  318. {
  319. text: '图标选择器组件(2.3.0+)',
  320. link: '/components/icon-picker',
  321. },
  322. {
  323. text: '瀑布流组件(2.4.0+)',
  324. link: '/components/waterfall',
  325. },
  326. ],
  327. },
  328. {
  329. text: '函数式组件',
  330. children: [
  331. {
  332. text: 'ImageViewer 图片预览组件',
  333. link: '/components/image-viewer',
  334. },
  335. ],
  336. },
  337. ],
  338. '/': [
  339. {
  340. text: '指南',
  341. children: [
  342. {
  343. text: '介绍',
  344. link: '/guide/introduction',
  345. },
  346. {
  347. text: '开始',
  348. link: '/guide/',
  349. },
  350. {
  351. text: '项目配置',
  352. link: '/guide/settings',
  353. },
  354. {
  355. text: '路由',
  356. link: '/guide/router',
  357. },
  358. {
  359. text: '权限',
  360. link: '/guide/auth',
  361. },
  362. {
  363. text: 'Mock&联调',
  364. link: '/guide/mock',
  365. },
  366. {
  367. text: '组件注册',
  368. link: '/guide/component',
  369. },
  370. {
  371. text: '样式',
  372. link: '/guide/design',
  373. },
  374. {
  375. text: '构建&部署',
  376. link: '/guide/deploy',
  377. },
  378. ],
  379. },
  380. {
  381. text: '深入',
  382. children: [
  383. {
  384. text: '国际化',
  385. link: '/dep/i18n',
  386. },
  387. {
  388. text: '项目规范',
  389. link: '/dep/lint',
  390. },
  391. {
  392. text: '黑暗主题',
  393. link: '/dep/dark',
  394. },
  395. {
  396. text: '模版生成',
  397. link: '/dep/create-module',
  398. },
  399. ],
  400. },
  401. {
  402. text: 'v2版本重大更新',
  403. children: [
  404. {
  405. text: '介绍',
  406. link: '/guide/version',
  407. },
  408. ],
  409. },
  410. ],
  411. };
  412. }