config.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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. }
  148. function createSidebar() {
  149. return {
  150. '/hooks/': [
  151. {
  152. text: 'useWatermark',
  153. link: '/hooks/useWatermark',
  154. },
  155. {
  156. text: 'useCrudSchemas',
  157. link: '/hooks/useCrudSchemas',
  158. },
  159. ],
  160. '/components/': [
  161. {
  162. text: '组件',
  163. children: [
  164. {
  165. text: '前言',
  166. link: '/components/introduction',
  167. },
  168. ],
  169. },
  170. {
  171. text: '全局组件',
  172. children: [
  173. {
  174. text: 'Icon 图标组件',
  175. link: '/components/icon',
  176. },
  177. {
  178. text: 'Permission 权限组件',
  179. link: '/components/permission',
  180. },
  181. ],
  182. },
  183. {
  184. text: '功能组件',
  185. children: [
  186. {
  187. text: 'Form 表单组件',
  188. link: '/components/form',
  189. },
  190. {
  191. text: 'Table 表格组件',
  192. link: '/components/table',
  193. },
  194. {
  195. text: 'Editor 富文本组件',
  196. link: '/components/editor',
  197. },
  198. {
  199. text: 'Search 查询组件',
  200. link: '/components/search',
  201. },
  202. {
  203. text: 'Descriptions 描述组件',
  204. link: '/components/descriptions',
  205. },
  206. {
  207. text: 'Dialog 弹窗组件',
  208. link: '/components/dialog',
  209. },
  210. {
  211. text: 'Echart 图表组件',
  212. link: '/components/echart',
  213. },
  214. {
  215. text: 'CountTo 数字动画组件',
  216. link: '/components/count-to',
  217. },
  218. {
  219. text: 'Qrcode 二维码组件',
  220. link: '/components/qrcode',
  221. },
  222. {
  223. text: 'Highlight 高亮组件',
  224. link: '/components/highlight',
  225. },
  226. {
  227. text: 'Infotip 信息提示组件',
  228. link: '/components/infotip',
  229. },
  230. {
  231. text: 'Error 缺省组件',
  232. link: '/components/error',
  233. },
  234. {
  235. text: 'Sticky 黏性组件',
  236. link: '/components/sticky',
  237. },
  238. {
  239. text: 'ContentDetailWrap 详情包裹组件',
  240. link: '/components/content-detail-wrap',
  241. },
  242. {
  243. text: 'InputPassword 密码输入框组件',
  244. link: '/components/input-password',
  245. },
  246. {
  247. text: 'Footer 页脚组件',
  248. link: '/components/footer',
  249. },
  250. ],
  251. },
  252. {
  253. text: '函数式组件',
  254. children: [
  255. {
  256. text: 'ImageViewer 图片预览组件',
  257. link: '/components/image-viewer',
  258. },
  259. ],
  260. },
  261. ],
  262. '/': [
  263. {
  264. text: '指南',
  265. children: [
  266. {
  267. text: '介绍',
  268. link: '/guide/introduction',
  269. },
  270. {
  271. text: '开始',
  272. link: '/guide/',
  273. },
  274. {
  275. text: '项目配置',
  276. link: '/guide/settings',
  277. },
  278. {
  279. text: '路由',
  280. link: '/guide/router',
  281. },
  282. {
  283. text: '权限',
  284. link: '/guide/auth',
  285. },
  286. {
  287. text: 'Mock&联调',
  288. link: '/guide/mock',
  289. },
  290. {
  291. text: '组件注册',
  292. link: '/guide/component',
  293. },
  294. {
  295. text: '样式',
  296. link: '/guide/design',
  297. },
  298. {
  299. text: '构建&部署',
  300. link: '/guide/deploy',
  301. },
  302. ],
  303. },
  304. {
  305. text: '深入',
  306. children: [
  307. {
  308. text: '国际化',
  309. link: '/dep/i18n',
  310. },
  311. {
  312. text: '项目规范',
  313. link: '/dep/lint',
  314. },
  315. {
  316. text: '黑暗主题',
  317. link: '/dep/dark',
  318. },
  319. {
  320. text: '模版生成',
  321. link: '/dep/create-module',
  322. },
  323. ],
  324. },
  325. {
  326. text: 'v2版本重大更新',
  327. children: [
  328. {
  329. text: '介绍',
  330. link: '/guide/version',
  331. },
  332. ],
  333. },
  334. ],
  335. };
  336. }