zh.mts 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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. },
  193. ];
  194. }
  195. function nav(): DefaultTheme.NavItem[] {
  196. return [
  197. {
  198. activeMatch: '^/(guide|components)/',
  199. text: '文档',
  200. items: [
  201. {
  202. activeMatch: '^/guide/',
  203. link: '/guide/introduction/vben',
  204. text: '指南',
  205. },
  206. {
  207. activeMatch: '^/components/',
  208. link: '/components/introduction',
  209. text: '组件',
  210. },
  211. {
  212. text: '历史版本',
  213. items: [
  214. {
  215. link: 'https://doc.vvbin.cn',
  216. text: '2.x版本文档',
  217. },
  218. ],
  219. },
  220. ],
  221. },
  222. {
  223. text: '演示',
  224. items: [
  225. {
  226. text: 'Vben Admin',
  227. items: [
  228. {
  229. link: 'https://www.vben.pro',
  230. text: '演示版本',
  231. },
  232. {
  233. link: 'https://ant.vben.pro',
  234. text: 'Ant Design Vue 版本',
  235. },
  236. {
  237. link: 'https://naive.vben.pro',
  238. text: 'Naive 版本',
  239. },
  240. {
  241. link: 'https://ele.vben.pro',
  242. text: 'Element Plus版本',
  243. },
  244. ],
  245. },
  246. {
  247. text: '其他',
  248. items: [
  249. {
  250. link: 'https://vben.vvbin.cn',
  251. text: 'Vben Admin 2.x',
  252. },
  253. ],
  254. },
  255. ],
  256. },
  257. {
  258. text: version,
  259. items: [
  260. {
  261. link: 'https://github.com/vbenjs/vue-vben-admin/releases',
  262. text: '更新日志',
  263. },
  264. {
  265. link: 'https://github.com/orgs/vbenjs/projects/5',
  266. text: '路线图',
  267. },
  268. {
  269. link: 'https://github.com/vbenjs/vue-vben-admin/blob/main/.github/contributing.md',
  270. text: '贡献',
  271. },
  272. ],
  273. },
  274. {
  275. link: '/commercial/technical-support',
  276. text: '🦄 技术支持',
  277. },
  278. {
  279. link: '/sponsor/personal',
  280. text: '✨ 赞助',
  281. },
  282. {
  283. link: '/commercial/community',
  284. text: '👨‍👦‍👦 交流群',
  285. // items: [
  286. // {
  287. // 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',
  288. // text: 'QQ频道',
  289. // },
  290. // {
  291. // link: 'https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=mjZmlhgVzzUxvdxllB6C1vHpX8O8QRL0&authKey=DBdFbBwERmfaKY95JvRWqLCJIRGJAmKyZbrpzZ41EKDMZ5SR6MfbjOBaaNRN73fr&noverify=0&group_code=4286109',
  292. // text: 'QQ群',
  293. // },
  294. // {
  295. // link: 'https://discord.gg/VU62jTecad',
  296. // text: 'Discord',
  297. // },
  298. // ],
  299. },
  300. // {
  301. // link: '/friend-links/',
  302. // text: '🤝 友情链接',
  303. // },
  304. ];
  305. }
  306. export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
  307. root: {
  308. placeholder: '搜索文档',
  309. translations: {
  310. button: {
  311. buttonAriaLabel: '搜索文档',
  312. buttonText: '搜索文档',
  313. },
  314. modal: {
  315. errorScreen: {
  316. helpText: '你可能需要检查你的网络连接',
  317. titleText: '无法获取结果',
  318. },
  319. footer: {
  320. closeText: '关闭',
  321. navigateText: '切换',
  322. searchByText: '搜索提供者',
  323. selectText: '选择',
  324. },
  325. noResultsScreen: {
  326. noResultsText: '无法找到相关结果',
  327. reportMissingResultsLinkText: '点击反馈',
  328. reportMissingResultsText: '你认为该查询应该有结果?',
  329. suggestedQueryText: '你可以尝试查询',
  330. },
  331. searchBox: {
  332. cancelButtonAriaLabel: '取消',
  333. cancelButtonText: '取消',
  334. resetButtonAriaLabel: '清除查询条件',
  335. resetButtonTitle: '清除查询条件',
  336. },
  337. startScreen: {
  338. favoriteSearchesTitle: '收藏',
  339. noRecentSearchesText: '没有搜索历史',
  340. recentSearchesTitle: '搜索历史',
  341. removeFavoriteSearchButtonTitle: '从收藏中移除',
  342. removeRecentSearchButtonTitle: '从搜索历史中移除',
  343. saveRecentSearchButtonTitle: '保存至搜索历史',
  344. },
  345. },
  346. },
  347. },
  348. };