import { defineConfig, type HeadConfig } from 'vitepress'; export default defineConfig({ base: '/', title: 'Eci Admin', lang: 'zh-CN', description: '一个开箱即用的前端框架', head: createHead(), lastUpdated: true, cleanUrls: true, ignoreDeadLinks: true, themeConfig: { repo: 'http://192.168.9.192/eci-frontend/base-framework', docsRepo: 'http://192.168.9.192/eci-frontend/base-framework-docs', logo: '/logo.png', docsBranch: 'main', editLinks: true, editLinkText: '为此页提供修改建议', socialLinks: [ { icon: 'github', link: 'http://192.168.9.192/eci-frontend/base-framework-docs' }, ], search: { provider: 'local', }, nav: createNav(), sidebar: createSidebar(), footer: { message: 'Released under the MIT License.', copyright: 'Copyright © 2023-present Freud', }, outline: 'deep', }, }); function createHead(): HeadConfig[] { return [ ['meta', { name: 'freud', content: 'Eci' }], [ 'meta', { name: 'keywords', content: 'vben, vitejs, vite, ant-design-vue, vue', }, ], ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.png' }], [ 'meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no', }, ], ['meta', { name: 'keywords', content: 'eci base framework docs' }], ['link', { rel: 'icon', href: '/favicon.ico' }], ]; } /** * @type {()=>import('./theme-default/config').DefaultTheme.NavItem[]} */ function createNav() { return [ { text: '指南', items: [ { text: '指南', link: '/guide/introduction', }, { text: '深入', link: '/dep/icon', }, { text: '其他', link: '/other/faq', }, ], }, { text: '本地依赖库', items: [ { text: '介绍', link: '/packages/introduction', }, { text: '公共接口', link: '/packages/api/uploadApi', }, { text: '公共图片资源', link: '/packages/assets', }, { text: '公共样式文件', link: '/packages/design', }, { text: '公共指令', link: '/packages/directives', }, { text: '公共hooks', link: '/packages/hooks', }, { text: '公共布局', link: '/packages/layout', }, { text: '公共多语言', link: '/packages/locales', }, { text: '公共请求', link: '/packages/request', }, { text: '公共路由', link: '/packages/router', }, { text: '共享函数工具库', link: '/packages/shared', }, { text: '公共数据仓库', link: '/packages/store', }, { text: '公共类型库', link: '/packages/types', }, { text: 'antdv组件库', link: '/packages/ant-ui', }, { text: '业务组件库', link: '/packages/business-ui', }, { text: '通用组件库', link: '/packages/share-ui', }, ], }, { text: '组件', items: [ { text: '介绍', link: '/components/introduction', }, { text: '全局组件', link: '/components/glob/button', }, { text: '通用组件', link: '/components/share-ui/text', }, { text: 'antdv组件', link: '/components/ant-ui/page', }, { text: '业务组件', link: '/components/business-ui/approve', }, { text: '函数式组件', link: '/components/functional/context-menu', }, ], }, { text: '相关链接', items: [ { text: '快速预览', link: 'http://starter.eciol-dev.com', }, { text: '源码仓库', link: 'http://192.168.9.192/eci-frontend/base-framework', }, { text: '子项目快速启动模板', link: 'http://192.168.9.192/eci-frontend/starter-template', }, { text: '文档源码', link: 'http://192.168.9.192/eci-frontend/base-framework-docs', }, { text: '更新日志', link: 'http://192.168.9.192/eci-frontend/base-framework/-/blob/main/CHANGELOG.md', }, ], }, ]; } function createSidebar() { return { '/components/': [ { text: '组件', items: [ { text: '前言', link: '/components/introduction', }, ], }, { text: '全局组件', items: [ { text: 'Button', link: '/components/glob/button', }, ], }, { text: '通用组件', items: [ { text: 'Text', link: '/components/share-ui/text', }, { text: 'BasicTitle', link: '/components/share-ui/basic-title', }, { text: 'BasicHelp', link: '/components/share-ui/basic-help', }, { text: 'BasicArrow', link: '/components/share-ui/basic-arrow', }, { text: 'Authority', link: '/components/share-ui/auth', }, { text: 'Icon', link: '/components/share-ui/icon', }, { text: 'CollapseContainer', link: '/components/share-ui/collapse-container', }, { text: 'ScrollContainer', link: '/components/share-ui/scroll-container', }, { text: 'LazyContainer', link: '/components/share-ui/lazy-container', }, { text: 'ClickOutSide', link: '/components/share-ui/click-out-side', }, { text: 'Qrcode', link: '/components/share-ui/qrcode', }, { text: 'Tinymce', link: '/components/share-ui/tinymce', }, { text: 'Time', link: '/components/share-ui/time', }, { text: 'Verify', link: '/components/share-ui/verify', }, { text: 'Transition', link: '/components/share-ui/transition', }, { text: 'VirtualScroll', link: '/components/share-ui/virtual-scroll', }, ], }, { text: 'antdv组件', items: [ { text: 'Page', link: '/components/ant-ui/page', }, { text: 'Form', link: '/components/ant-ui/form', }, { text: 'Table', link: '/components/ant-ui/table', }, { text: 'PopConfirmButton', link: '/components/ant-ui/pop-confirm-button', }, { text: 'CountDown', link: '/components/ant-ui/count-down', }, { text: 'CountTo', link: '/components/ant-ui/count-to', }, { text: 'Cropper', link: '/components/ant-ui/cropper', }, { text: 'Description', link: '/components/ant-ui/desc', }, { text: 'Drawer', link: '/components/ant-ui/drawer', }, { text: 'Modal', link: '/components/ant-ui/modal', }, { text: 'Upload', link: '/components/ant-ui/upload', }, { text: 'Tree', link: '/components/ant-ui/tree', }, { text: 'Loading', link: '/components/ant-ui/loading', }, ], }, { text: '业务组件', items: [ { text: 'ApproveWrapper', link: '/components/business-ui/approve', }, ], }, { text: '函数式组件', items: [ { text: 'ContextMenu', link: '/components/functional/context-menu', }, { text: 'Loading', link: '/components/functional/loading', }, ], }, ], '/': [ { text: '指南', items: [ { text: '介绍', link: '/guide/introduction', }, { text: '开始', link: '/guide/', }, { text: '项目配置', link: '/guide/settings', }, { text: '路由', link: '/guide/router', }, { text: '菜单', link: '/guide/menu', }, { text: '权限', link: '/guide/auth', }, { text: 'Mock&联调', link: '/guide/mock', }, { text: '组件注册', link: '/guide/component', }, { text: '样式', link: '/guide/design', }, { text: '外部模块', link: '/guide/lib', }, { text: '构建&部署', link: '/guide/deploy', }, // { // text: 'Electron', // link: '/guide/electron', // }, ], }, { text: '深入', items: [ { text: '跨域处理', link: '/dep/cors', }, { text: '图标', link: '/dep/icon', }, { text: '国际化', link: '/dep/i18n', }, { text: '项目规范', link: '/dep/lint', }, // { // text: '黑暗主题', // link: '/dep/dark', // }, ], }, { text: '其他', items: [ { text: '常见问题', link: '/other/faq', }, { text: '常见疑点', link: '/other/doubt', }, { text: '测试服务', link: '/other/server', }, { text: '相关项目', link: '/other/project', }, ], }, ], '/packages/': [ { text: '本地依赖库', items: [ { text: '前言', link: '/packages/introduction', }, ], }, { text: 'api', items: [ { text: 'uploadApi', link: '/packages/api/uploadApi', }, { text: 'downloadApi', link: '/packages/api/downloadApi', }, ], }, { text: 'assets', link: '/packages/assets', }, { text: 'design', link: '/packages/design', }, { text: 'directives', link: '/packages/directives', }, { text: 'hooks', items: [ { text: 'core', items: [ { text: 'onMountedOrActivated', link: '/packages/hooks/core/onMountedOrActivated', }, { text: 'useAttrs', link: '/packages/hooks/core/useAttrs', }, { text: 'useContext', link: '/packages/hooks/core/useContext', }, { text: 'useNamespace', link: '/packages/hooks/core/useNamespace', }, { text: 'useRequest', link: '/packages/hooks/core/useRequest', }, { text: 'useScript', link: '/packages/hooks/core/useScript', }, { text: 'useScrollTo', link: '/packages/hooks/core/useScrollTo', }, { text: 'useSortable', link: '/packages/hooks/core/useSortable', }, { text: 'useWatermark', link: '/packages/hooks/core/useWatermark', }, { text: 'useWindowSizeFn', link: '/packages/hooks/core/useWindowSizeFn', }, ], }, { text: 'web', items: [ { text: 'useAppContext', link: '/packages/hooks/web/useAppContext', }, { text: 'useECharts', link: '/packages/hooks/web/useECharts', }, { text: 'usePage', link: '/packages/hooks/web/usePage', }, { text: 'useTabs', link: '/packages/hooks/web/useTabs', }, ], }, ], }, { text: 'layout', link: '/packages/layout', }, { text: 'locales', link: '/packages/locales', }, { text: 'request', link: '/packages/request', }, { text: 'router', link: '/packages/router', }, { text: 'shared', link: '/packages/shared', }, { text: 'store', link: '/packages/store', }, { text: 'types', link: '/packages/types', }, { text: 'ant-ui', link: '/packages/ant-ui', }, { text: 'business-ui', link: '/packages/business-ui', }, { text: 'share-ui', link: '/packages/share-ui', }, ], }; } // /** // * @type {(namespace:string,items:string[])=>string[]} // */ // function urlWrapper(namespace, items) { // return items.map((item) => namespace + item); // } // function getGuildNav() { // return urlWrapper('/guide', ['/']); // }