config.js 8.5 KB

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