zh.mts 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. import type { DefaultTheme } from 'vitepress';
  2. import { defineConfig } from 'vitepress';
  3. import { version } from '../../../package.json';
  4. export const zh = defineConfig({
  5. description: 'Vben Admin & 企业级管理系统框架',
  6. lang: 'zh-Hans',
  7. themeConfig: {
  8. darkModeSwitchLabel: '主题',
  9. darkModeSwitchTitle: '切换到深色模式',
  10. docFooter: {
  11. next: '下一页',
  12. prev: '上一页',
  13. },
  14. editLink: {
  15. pattern:
  16. 'https://github.com/vbenjs/vue-vben-admin/edit/main/docs/src/:path',
  17. text: '在 GitHub 上编辑此页面',
  18. },
  19. footer: {
  20. copyright: `Copyright © 2020-${new Date().getFullYear()} Vben`,
  21. message: '基于 MIT 许可发布.',
  22. },
  23. langMenuLabel: '多语言',
  24. lastUpdated: {
  25. formatOptions: {
  26. dateStyle: 'short',
  27. timeStyle: 'medium',
  28. },
  29. text: '最后更新于',
  30. },
  31. lightModeSwitchTitle: '切换到浅色模式',
  32. nav: nav(),
  33. outline: {
  34. label: '页面导航',
  35. },
  36. returnToTopLabel: '回到顶部',
  37. sidebar: {
  38. '/commercial/': { base: '/commercial/', items: sidebarCommercial() },
  39. '/components/': { base: '/components/', items: sidebarComponents() },
  40. '/guide/': { base: '/guide/', items: sidebarGuide() },
  41. },
  42. sidebarMenuLabel: '菜单',
  43. },
  44. });
  45. function sidebarGuide(): DefaultTheme.SidebarItem[] {
  46. return [
  47. {
  48. collapsed: false,
  49. text: '简介',
  50. items: [
  51. {
  52. link: 'introduction/vben',
  53. text: '关于 Vben Admin',
  54. },
  55. {
  56. link: 'introduction/why',
  57. text: '为什么选择我们?',
  58. },
  59. { link: 'introduction/quick-start', text: '快速开始' },
  60. { link: 'introduction/thin', text: '精简版本' },
  61. {
  62. base: '/',
  63. link: 'components/introduction',
  64. text: '组件文档',
  65. },
  66. ],
  67. },
  68. {
  69. text: '基础',
  70. items: [
  71. { link: 'essentials/concept', text: '基础概念' },
  72. { link: 'essentials/development', text: '本地开发' },
  73. { link: 'essentials/route', text: '路由和菜单' },
  74. { link: 'essentials/settings', text: '配置' },
  75. { link: 'essentials/icons', text: '图标' },
  76. { link: 'essentials/styles', text: '样式' },
  77. { link: 'essentials/external-module', text: '外部模块' },
  78. { link: 'essentials/build', text: '构建与部署' },
  79. { link: 'essentials/server', text: '服务端交互与数据Mock' },
  80. ],
  81. },
  82. {
  83. text: '深入',
  84. items: [
  85. { link: 'in-depth/login', text: '登录' },
  86. // { link: 'in-depth/layout', text: '布局' },
  87. { link: 'in-depth/theme', text: '主题' },
  88. { link: 'in-depth/access', text: '权限' },
  89. { link: 'in-depth/locale', text: '国际化' },
  90. { link: 'in-depth/features', text: '常用功能' },
  91. { link: 'in-depth/check-updates', text: '检查更新' },
  92. { link: 'in-depth/loading', text: '全局loading' },
  93. { link: 'in-depth/ui-framework', text: '组件库切换' },
  94. ],
  95. },
  96. {
  97. text: '工程',
  98. items: [
  99. { link: 'project/standard', text: '规范' },
  100. { link: 'project/cli', text: 'CLI' },
  101. { link: 'project/dir', text: '目录说明' },
  102. { link: 'project/test', text: '单元测试' },
  103. { link: 'project/tailwindcss', text: 'Tailwind CSS' },
  104. { link: 'project/changeset', text: 'Changeset' },
  105. { link: 'project/vite', text: 'Vite Config' },
  106. ],
  107. },
  108. {
  109. text: '其他',
  110. items: [
  111. { link: 'other/project-update', text: '项目更新' },
  112. { link: 'other/remove-code', text: '移除代码' },
  113. { link: 'other/faq', text: '常见问题' },
  114. ],
  115. },
  116. ];
  117. }
  118. function sidebarCommercial(): DefaultTheme.SidebarItem[] {
  119. return [
  120. {
  121. link: 'community',
  122. text: '交流群',
  123. },
  124. {
  125. link: 'technical-support',
  126. text: '技术支持',
  127. },
  128. {
  129. link: 'customized',
  130. text: '定制开发',
  131. },
  132. ];
  133. }
  134. function sidebarComponents(): DefaultTheme.SidebarItem[] {
  135. return [
  136. {
  137. text: '组件',
  138. items: [
  139. {
  140. link: 'introduction',
  141. text: '介绍',
  142. },
  143. ],
  144. },
  145. {
  146. collapsed: false,
  147. text: '布局组件',
  148. items: [
  149. {
  150. link: 'layout-ui/page',
  151. text: 'Page 页面',
  152. },
  153. ],
  154. },
  155. {
  156. collapsed: false,
  157. text: '通用组件',
  158. items: [
  159. {
  160. link: 'common-ui/vben-api-component',
  161. text: 'ApiComponent Api组件包装器',
  162. },
  163. {
  164. link: 'common-ui/vben-alert',
  165. text: 'Alert 轻量提示框',
  166. },
  167. {
  168. link: 'common-ui/vben-modal',
  169. text: 'Modal 模态框',
  170. },
  171. {
  172. link: 'common-ui/vben-drawer',
  173. text: 'Drawer 抽屉',
  174. },
  175. {
  176. link: 'common-ui/vben-form',
  177. text: 'Form 表单',
  178. },
  179. {
  180. link: 'common-ui/vben-vxe-table',
  181. text: 'Vxe Table 表格',
  182. },
  183. {
  184. link: 'common-ui/vben-count-to-animator',
  185. text: 'CountToAnimator 数字动画',
  186. },
  187. {
  188. link: 'common-ui/vben-ellipsis-text',
  189. text: 'EllipsisText 省略文本',
  190. },
  191. {
  192. link: 'common-ui/vben-cropper',
  193. text: 'Cropper 图片裁剪',
  194. },
  195. {
  196. link: 'common-ui/vben-tiptap',
  197. text: 'Tiptap 富文本编辑器',
  198. },
  199. ],
  200. },
  201. ];
  202. }
  203. function nav(): DefaultTheme.NavItem[] {
  204. return [
  205. {
  206. activeMatch: '^/(guide|components)/',
  207. text: '文档',
  208. items: [
  209. {
  210. activeMatch: '^/guide/',
  211. link: '/guide/introduction/vben',
  212. text: '指南',
  213. },
  214. {
  215. activeMatch: '^/components/',
  216. link: '/components/introduction',
  217. text: '组件',
  218. },
  219. {
  220. text: '历史版本',
  221. items: [
  222. {
  223. link: 'https://doc.vvbin.cn',
  224. text: '2.x版本文档',
  225. },
  226. ],
  227. },
  228. ],
  229. },
  230. {
  231. text: '演示',
  232. items: [
  233. {
  234. text: 'Vben Admin',
  235. items: [
  236. {
  237. link: 'https://www.vben.pro',
  238. text: '演示版本',
  239. },
  240. {
  241. link: 'https://ant.vben.pro',
  242. text: 'Ant Design Vue 版本',
  243. },
  244. {
  245. link: 'https://naive.vben.pro',
  246. text: 'Naive 版本',
  247. },
  248. {
  249. link: 'https://ele.vben.pro',
  250. text: 'Element Plus版本',
  251. },
  252. ],
  253. },
  254. {
  255. text: '其他',
  256. items: [
  257. {
  258. link: 'https://vben.vvbin.cn',
  259. text: 'Vben Admin 2.x',
  260. },
  261. ],
  262. },
  263. ],
  264. },
  265. {
  266. text: version,
  267. items: [
  268. {
  269. link: 'https://github.com/vbenjs/vue-vben-admin/releases',
  270. text: '更新日志',
  271. },
  272. {
  273. link: 'https://github.com/orgs/vbenjs/projects/5',
  274. text: '路线图',
  275. },
  276. {
  277. link: 'https://github.com/vbenjs/vue-vben-admin/blob/main/.github/contributing.md',
  278. text: '贡献',
  279. },
  280. ],
  281. },
  282. {
  283. link: '/commercial/technical-support',
  284. text: '🦄 技术支持',
  285. },
  286. {
  287. link: '/sponsor/personal',
  288. text: '✨ 赞助',
  289. },
  290. {
  291. link: '/commercial/community',
  292. text: '👨‍👦‍👦 交流群',
  293. // items: [
  294. // {
  295. // link: 'https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&appChannel=share&inviteCode=22ySzj7pKiw&businessType=9&from=246610&biz=ka&mainSourceId=share&subSourceId=others&jumpsource=shorturl#/pc',
  296. // text: 'QQ频道',
  297. // },
  298. // {
  299. // link: 'https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=mjZmlhgVzzUxvdxllB6C1vHpX8O8QRL0&authKey=DBdFbBwERmfaKY95JvRWqLCJIRGJAmKyZbrpzZ41EKDMZ5SR6MfbjOBaaNRN73fr&noverify=0&group_code=4286109',
  300. // text: 'QQ群',
  301. // },
  302. // {
  303. // link: 'https://discord.gg/VU62jTecad',
  304. // text: 'Discord',
  305. // },
  306. // ],
  307. },
  308. // {
  309. // link: '/friend-links/',
  310. // text: '🤝 友情链接',
  311. // },
  312. ];
  313. }
  314. export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
  315. root: {
  316. placeholder: '搜索文档',
  317. translations: {
  318. button: {
  319. buttonAriaLabel: '搜索文档',
  320. buttonText: '搜索文档',
  321. },
  322. modal: {
  323. errorScreen: {
  324. helpText: '你可能需要检查你的网络连接',
  325. titleText: '无法获取结果',
  326. },
  327. footer: {
  328. closeText: '关闭',
  329. navigateText: '切换',
  330. selectText: '选择',
  331. poweredByText: '搜索提供者',
  332. },
  333. noResultsScreen: {
  334. noResultsText: '无法找到相关结果',
  335. reportMissingResultsLinkText: '点击反馈',
  336. reportMissingResultsText: '你认为该查询应该有结果?',
  337. suggestedQueryText: '你可以尝试查询',
  338. },
  339. searchBox: {
  340. closeButtonAriaLabel: '取消',
  341. closeButtonText: '取消',
  342. clearButtonAriaLabel: '清除查询条件',
  343. clearButtonTitle: '清除查询条件',
  344. },
  345. startScreen: {
  346. favoriteSearchesTitle: '收藏',
  347. noRecentSearchesText: '没有搜索历史',
  348. recentSearchesTitle: '搜索历史',
  349. removeFavoriteSearchButtonTitle: '从收藏中移除',
  350. removeRecentSearchButtonTitle: '从搜索历史中移除',
  351. saveRecentSearchButtonTitle: '保存至搜索历史',
  352. },
  353. },
  354. },
  355. },
  356. };