config.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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. },
  117. {
  118. text: '相关链接',
  119. items: [
  120. {
  121. text: 'Github 站点预览',
  122. link: 'https://element-plus-admin.cn/',
  123. },
  124. {
  125. text: 'Github 源码',
  126. link: 'https://github.com/kailong321200875/vue-element-plus-admin',
  127. },
  128. {
  129. text: 'Github 文档源码',
  130. link: 'https://github.com/kailong321200875/vue-element-plus-admin-doc',
  131. },
  132. {
  133. text: 'Github 更新日志',
  134. link: 'https://github.com/kailong321200875/vue-element-plus-admin/blob/master/CHANGELOG.md',
  135. },
  136. {
  137. text: 'Gitee 站点预览',
  138. link: 'https://kailong110120130.gitee.io/vue-element-plus-admin',
  139. },
  140. {
  141. text: 'Gitee 源码',
  142. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin',
  143. },
  144. {
  145. text: 'Gitee 文档源码',
  146. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin-doc',
  147. },
  148. {
  149. text: 'Gitee 更新日志',
  150. link: 'https://gitee.com/kailong110120130/vue-element-plus-admin/blob/master/CHANGELOG.md',
  151. },
  152. ],
  153. },
  154. {
  155. text: '交流群',
  156. link: '/group/',
  157. items: [
  158. {
  159. text: '技术交流群',
  160. link: '/group/group',
  161. },
  162. ],
  163. },
  164. {
  165. text: '捐赠',
  166. link: '/donate/',
  167. items: [
  168. {
  169. text: '捐赠',
  170. link: '/donate/donate',
  171. },
  172. ],
  173. },
  174. ];
  175. }
  176. function createSidebar() {
  177. return {
  178. '/group/': [
  179. {
  180. text: '技术交流群',
  181. link: '/group/group',
  182. },
  183. ],
  184. '/donate/': [
  185. {
  186. text: '捐赠',
  187. link: '/donate/donate',
  188. },
  189. ],
  190. '/hooks/': [
  191. {
  192. text: 'useWatermark',
  193. link: '/hooks/useWatermark',
  194. },
  195. {
  196. text: 'useCrudSchemas',
  197. link: '/hooks/useCrudSchemas',
  198. },
  199. {
  200. text: 'useTagsView(2.1.0+)',
  201. link: '/hooks/useTagsView',
  202. },
  203. {
  204. text: 'useStorage(2.1.0+)',
  205. link: '/hooks/useStorage',
  206. },
  207. ],
  208. '/components/': [
  209. {
  210. text: '组件',
  211. children: [
  212. {
  213. text: '前言',
  214. link: '/components/introduction',
  215. },
  216. ],
  217. },
  218. {
  219. text: '全局组件',
  220. children: [
  221. {
  222. text: 'Icon 图标组件',
  223. link: '/components/icon',
  224. },
  225. {
  226. text: 'Permission 权限组件(2.1.0+)',
  227. link: '/components/permission',
  228. },
  229. ],
  230. },
  231. {
  232. text: '功能组件',
  233. children: [
  234. {
  235. text: 'Form 表单组件',
  236. link: '/components/form',
  237. },
  238. {
  239. text: 'Table 表格组件',
  240. link: '/components/table',
  241. },
  242. {
  243. text: 'Editor 富文本组件',
  244. link: '/components/editor',
  245. },
  246. {
  247. text: 'Search 查询组件',
  248. link: '/components/search',
  249. },
  250. {
  251. text: 'Descriptions 描述组件',
  252. link: '/components/descriptions',
  253. },
  254. {
  255. text: 'Dialog 弹窗组件',
  256. link: '/components/dialog',
  257. },
  258. {
  259. text: 'Echart 图表组件',
  260. link: '/components/echart',
  261. },
  262. {
  263. text: 'CountTo 数字动画组件',
  264. link: '/components/count-to',
  265. },
  266. {
  267. text: 'Qrcode 二维码组件',
  268. link: '/components/qrcode',
  269. },
  270. {
  271. text: 'Highlight 高亮组件',
  272. link: '/components/highlight',
  273. },
  274. {
  275. text: 'Infotip 信息提示组件',
  276. link: '/components/infotip',
  277. },
  278. {
  279. text: 'Error 缺省组件',
  280. link: '/components/error',
  281. },
  282. {
  283. text: 'Sticky 黏性组件',
  284. link: '/components/sticky',
  285. },
  286. {
  287. text: 'ContentDetailWrap 详情包裹组件',
  288. link: '/components/content-detail-wrap',
  289. },
  290. {
  291. text: 'InputPassword 密码输入框组件',
  292. link: '/components/input-password',
  293. },
  294. {
  295. text: 'Footer 页脚组件',
  296. link: '/components/footer',
  297. },
  298. {
  299. text: 'JsonEditor JSON编辑器组件(2.2.0+)',
  300. link: '/components/json-editor',
  301. },
  302. ],
  303. },
  304. {
  305. text: '函数式组件',
  306. children: [
  307. {
  308. text: 'ImageViewer 图片预览组件',
  309. link: '/components/image-viewer',
  310. },
  311. ],
  312. },
  313. ],
  314. '/': [
  315. {
  316. text: '指南',
  317. children: [
  318. {
  319. text: '介绍',
  320. link: '/guide/introduction',
  321. },
  322. {
  323. text: '开始',
  324. link: '/guide/',
  325. },
  326. {
  327. text: '项目配置',
  328. link: '/guide/settings',
  329. },
  330. {
  331. text: '路由',
  332. link: '/guide/router',
  333. },
  334. {
  335. text: '权限',
  336. link: '/guide/auth',
  337. },
  338. {
  339. text: 'Mock&联调',
  340. link: '/guide/mock',
  341. },
  342. {
  343. text: '组件注册',
  344. link: '/guide/component',
  345. },
  346. {
  347. text: '样式',
  348. link: '/guide/design',
  349. },
  350. {
  351. text: '构建&部署',
  352. link: '/guide/deploy',
  353. },
  354. ],
  355. },
  356. {
  357. text: '深入',
  358. children: [
  359. {
  360. text: '国际化',
  361. link: '/dep/i18n',
  362. },
  363. {
  364. text: '项目规范',
  365. link: '/dep/lint',
  366. },
  367. {
  368. text: '黑暗主题',
  369. link: '/dep/dark',
  370. },
  371. {
  372. text: '模版生成',
  373. link: '/dep/create-module',
  374. },
  375. ],
  376. },
  377. {
  378. text: 'v2版本重大更新',
  379. children: [
  380. {
  381. text: '介绍',
  382. link: '/guide/version',
  383. },
  384. ],
  385. },
  386. ],
  387. };
  388. }