config.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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/useWatermark',
  98. },
  99. {
  100. text: '常见问题',
  101. link: '/guide/fqa',
  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. text: '捐赠',
  142. link: '/donate/',
  143. items: [
  144. {
  145. text: '捐赠',
  146. link: '/donate/donate',
  147. },
  148. ],
  149. },
  150. ];
  151. }
  152. function createSidebar() {
  153. return {
  154. '/donate/': [
  155. {
  156. text: '捐赠',
  157. link: '/donate/donate',
  158. },
  159. ],
  160. '/hooks/': [
  161. {
  162. text: 'useWatermark',
  163. link: '/hooks/useWatermark',
  164. },
  165. {
  166. text: 'useCrudSchemas',
  167. link: '/hooks/useCrudSchemas',
  168. },
  169. {
  170. text: 'useTagsView(2.1.0+)',
  171. link: '/hooks/useTagsView',
  172. },
  173. {
  174. text: 'useStorage(2.1.0+)',
  175. link: '/hooks/useStorage',
  176. },
  177. {
  178. text: 'useClipboard(2.4.0+)',
  179. link: '/hooks/useClipboard',
  180. },
  181. {
  182. text: 'useNetwork(2.4.0+)',
  183. link: '/hooks/useNetwork',
  184. },
  185. ],
  186. '/components/': [
  187. {
  188. text: '组件',
  189. children: [
  190. {
  191. text: '前言',
  192. link: '/components/introduction',
  193. },
  194. ],
  195. },
  196. {
  197. text: '全局组件',
  198. children: [
  199. {
  200. text: 'Icon 图标组件',
  201. link: '/components/icon',
  202. },
  203. {
  204. text: 'Permission 权限组件(2.1.0+)',
  205. link: '/components/permission',
  206. },
  207. {
  208. text: 'BaseButton 按钮组件(2.5.1+)',
  209. link: '/components/button',
  210. },
  211. ],
  212. },
  213. {
  214. text: '功能组件',
  215. children: [
  216. {
  217. text: 'Form 表单组件',
  218. link: '/components/form',
  219. },
  220. {
  221. text: 'Table 表格组件',
  222. link: '/components/table',
  223. },
  224. {
  225. text: 'Editor 富文本组件',
  226. link: '/components/editor',
  227. },
  228. {
  229. text: 'Search 查询组件',
  230. link: '/components/search',
  231. },
  232. {
  233. text: 'Descriptions 描述组件',
  234. link: '/components/descriptions',
  235. },
  236. {
  237. text: 'Dialog 弹窗组件',
  238. link: '/components/dialog',
  239. },
  240. {
  241. text: 'Echart 图表组件',
  242. link: '/components/echart',
  243. },
  244. {
  245. text: 'CountTo 数字动画组件',
  246. link: '/components/count-to',
  247. },
  248. {
  249. text: 'Qrcode 二维码组件',
  250. link: '/components/qrcode',
  251. },
  252. {
  253. text: 'Highlight 高亮组件',
  254. link: '/components/highlight',
  255. },
  256. {
  257. text: 'Infotip 信息提示组件',
  258. link: '/components/infotip',
  259. },
  260. {
  261. text: 'Error 缺省组件',
  262. link: '/components/error',
  263. },
  264. {
  265. text: 'ContentDetailWrap 详情包裹组件',
  266. link: '/components/content-detail-wrap',
  267. },
  268. {
  269. text: 'InputPassword 密码输入框组件',
  270. link: '/components/input-password',
  271. },
  272. {
  273. text: 'Footer 页脚组件',
  274. link: '/components/footer',
  275. },
  276. {
  277. text: 'JsonEditor JSON编辑器组件(2.2.0+)',
  278. link: '/components/json-editor',
  279. },
  280. {
  281. text: '图标选择器组件(2.3.0+)',
  282. link: '/components/icon-picker',
  283. },
  284. {
  285. text: '瀑布流组件(2.4.0+)',
  286. link: '/components/waterfall',
  287. },
  288. {
  289. text: '视频播放器组件(2.5.0+)',
  290. link: '/components/video-player',
  291. },
  292. {
  293. text: '头像列表组件(2.7.0+)',
  294. link: '/components/avatars',
  295. },
  296. {
  297. text: '我同意组件(2.7.0+)',
  298. link: '/components/i-agree',
  299. },
  300. ],
  301. },
  302. {
  303. text: '函数式组件',
  304. children: [
  305. {
  306. text: 'ImageViewer 图片预览组件',
  307. link: '/components/image-viewer',
  308. },
  309. {
  310. text: 'VideoViewer 图片预览组件(2.5.0+)',
  311. link: '/components/video-viewer',
  312. },
  313. ],
  314. },
  315. ],
  316. '/': [
  317. {
  318. text: '指南',
  319. children: [
  320. {
  321. text: '介绍',
  322. link: '/guide/introduction',
  323. },
  324. {
  325. text: '开始',
  326. link: '/guide/',
  327. },
  328. {
  329. text: '项目配置',
  330. link: '/guide/settings',
  331. },
  332. {
  333. text: '路由',
  334. link: '/guide/router',
  335. },
  336. {
  337. text: '权限',
  338. link: '/guide/auth',
  339. },
  340. {
  341. text: 'Mock&联调',
  342. link: '/guide/mock',
  343. },
  344. {
  345. text: '组件注册',
  346. link: '/guide/component',
  347. },
  348. {
  349. text: '样式',
  350. link: '/guide/design',
  351. },
  352. {
  353. text: '构建&部署',
  354. link: '/guide/deploy',
  355. },
  356. ],
  357. },
  358. {
  359. text: '深入',
  360. children: [
  361. {
  362. text: '国际化',
  363. link: '/dep/i18n',
  364. },
  365. {
  366. text: '项目规范',
  367. link: '/dep/lint',
  368. },
  369. {
  370. text: '黑暗主题',
  371. link: '/dep/dark',
  372. },
  373. {
  374. text: '模版生成',
  375. link: '/dep/create-module',
  376. },
  377. ],
  378. },
  379. {
  380. text: 'v2版本重大更新',
  381. children: [
  382. {
  383. text: '介绍',
  384. link: '/guide/version',
  385. },
  386. ],
  387. },
  388. {
  389. text: '常见问题',
  390. children: [
  391. {
  392. text: '前言',
  393. link: '/guide/fqa',
  394. },
  395. ],
  396. },
  397. ],
  398. };
  399. }