diff --git a/sites/.vitepress/config/sidebar.ts b/sites/.vitepress/config/sidebar.ts index d8aec335c3a9849d5555469ac44682de2528fb75..b47f0157602068e548f3351622789ba4c0ca5cb9 100644 --- a/sites/.vitepress/config/sidebar.ts +++ b/sites/.vitepress/config/sidebar.ts @@ -4,13 +4,13 @@ const sidebar = { { text: '通用', children: [ - { text: 'Button 按钮', link: '/components/button/' }, - { text: 'Icon 图标', link: '/components/icon/' }, + { text: 'Button 按钮', link: '/components/button/', status: '已完成' }, + { text: 'Icon 图标', link: '/components/icon/', status: '已完成' }, { text: 'DragDrop 拖拽', link: '/components/dragdrop/' }, { text: 'Fullscreen 全屏', link: '/components/fullscreen/' }, - { text: 'Panel 面板', link: '/components/panel/' }, - { text: 'Search 搜索框', link: '/components/search/' }, - { text: 'Status 状态', link: '/components/status/' }, + { text: 'Panel 面板', link: '/components/panel/', status: '已完成' }, + { text: 'Search 搜索框', link: '/components/search/', status: '已完成' }, + { text: 'Status 状态', link: '/components/status/', status: '已完成' }, { text: 'Sticky 便贴', link: '/components/sticky/' }, ] }, @@ -25,20 +25,20 @@ const sidebar = { { text: 'NavSprite 导航精灵', link: '/components/nav-sprite/' }, { text: 'Pagination 分页', link: '/components/pagination/' }, { text: 'StepsGuide 操作指引', link: '/components/steps-guide/' }, - { text: 'Tabs 选项卡', link: '/components/tabs/' }, + { text: 'Tabs 选项卡', link: '/components/tabs/', status: '已完成' }, ] }, { text: '反馈', children: [ - { text: 'Alert 警告', link: '/components/alert/' }, + { text: 'Alert 警告', link: '/components/alert/', status: '已完成' }, { text: 'Drawer 抽屉板', link: '/components/drawer/' }, - { text: 'Loading 加载提示', link: '/components/loading/' }, + { text: 'Loading 加载提示', link: '/components/loading/', status: '已完成' }, { text: 'Mention 提及', link: '/components/mention/' }, { text: 'Modal 模态弹窗', link: '/components/modal/' }, { text: 'Popover 悬浮提示', link: '/components/popover/' }, { text: 'ReadTip 阅读提示', link: '/components/read-tip/' }, - { text: 'Toast 全局通知', link: '/components/toast/' }, + { text: 'Toast 全局通知', link: '/components/toast/', status: '已完成' }, { text: 'Tooltip 提示', link: '/components/tooltip/' }, ] }, @@ -48,19 +48,19 @@ const sidebar = { { text: 'AutoComplete 自动补全', link: '/components/auto-complete/' }, { text: 'Cascader 级联菜单', link: '/components/cascader/' }, { text: 'CategorySearch 分类搜索', link: '/components/category-search/' }, - { text: 'Checkbox 复选框', link: '/components/checkbox/' }, + { text: 'Checkbox 复选框', link: '/components/checkbox/', status: '已完成' }, { text: 'DatePicker 日期选择器', link: '/components/date-picker/' }, { text: 'DatePickerPro 日期选择器', link: '/components/date-picker-pro/' }, { text: 'EditableSelect 可编辑下拉框', link: '/components/editable-select/' }, { text: 'Form 表单', link: '/components/form/' }, - { text: 'Input 文本框', link: '/components/input/' }, + { text: 'Input 文本框', link: '/components/input/', status: '已完成' }, { text: 'InputNumber 数字输入框', link: '/components/input-number/' }, { text: 'MultiAutoComplete 多项自动补全', link: '/components/multi-auto-complete/' }, - { text: 'Radio 单选框', link: '/components/radio/' }, - { text: 'Select 下拉选择框', link: '/components/select/' }, + { text: 'Radio 单选框', link: '/components/radio/', status: '已完成' }, + { text: 'Select 下拉选择框', link: '/components/select/', status: '已完成' }, { text: 'Slider 滑块', link: '/components/slider/' }, - { text: 'Switch 开关', link: '/components/switch/' }, - { text: 'TagInput 标签输入', link: '/components/tag-input/' }, + { text: 'Switch 开关', link: '/components/switch/', status: '已完成' }, + { text: 'TagInput 标签输入', link: '/components/tag-input/', status: '已完成' }, { text: 'Textarea 多行文本框', link: '/components/textarea/' }, { text: 'TimePicker 时间选择器', link: '/components/time-picker/' }, { text: 'Transfer 穿梭框', link: '/components/transfer/' }, @@ -71,16 +71,16 @@ const sidebar = { { text: '数据展示', children: [ - { text: 'Avatar 头像', link: '/components/avatar/' }, + { text: 'Avatar 头像', link: '/components/avatar/', status: '已完成' }, { text: 'Badge 徽标', link: '/components/badge/' }, - { text: 'Card 卡片', link: '/components/card/' }, - { text: 'Carousel 走马灯', link: '/components/carousel/' }, + { text: 'Card 卡片', link: '/components/card/', status: '已完成' }, + { text: 'Carousel 走马灯', link: '/components/carousel/', status: '已完成' }, { text: 'DataTable 表格', link: '/components/data-table/' }, { text: 'Gantt 甘特图', link: '/components/gantt/' }, { text: 'ImagePreview 图片预览', link: '/components/image-preview/' }, - { text: 'Progress 进度条', link: '/components/progress/' }, + { text: 'Progress 进度条', link: '/components/progress/', status: '已完成' }, { text: 'QuadrantDiagram 象限图', link: '/components/quadrant-diagram/' }, - { text: 'Rate 等级评估', link: '/components/rate/' }, + { text: 'Rate 等级评估', link: '/components/rate/', status: '已完成' }, { text: 'Tag 标签', link: '/components/tag/' }, { text: 'Tree 树', link: '/components/tree/' }, ] diff --git a/sites/.vitepress/devui-theme/components/SideBarLink.js b/sites/.vitepress/devui-theme/components/SideBarLink.js index 68b31d7122382a7b8dbf6c1fb1ce340b80342613..086f3c126e8ab359c020f98c681ed6f3751eb847 100644 --- a/sites/.vitepress/devui-theme/components/SideBarLink.js +++ b/sites/.vitepress/devui-theme/components/SideBarLink.js @@ -8,6 +8,8 @@ export const SideBarLink = (props) => { const maxDepth = frontmatter.value.sidebarDepth || Infinity; const headers = route.data.headers; const text = props.item.text; + const status = props.item.status; + console.log('text status:', text, status); const link = resolveLink(site.value.base, props.item.link); const children = props.item.children; const active = isActive(route, props.item.link); @@ -18,7 +20,12 @@ export const SideBarLink = (props) => { h(link ? 'a' : 'p', { class: { 'sidebar-link-item': true, active }, href: link - }, text), + }, [ + text, + status && h('span', { + class: 'sidebar-link-status' + }, status), + ]), childItems ]); }; diff --git a/sites/.vitepress/devui-theme/styles/sidebar-links.css b/sites/.vitepress/devui-theme/styles/sidebar-links.css index c15f53fdb038e289040e9e458b95ddb74dcbe7df..2567540dadb7580f0ca4dbc52aacff1656bc8362 100644 --- a/sites/.vitepress/devui-theme/styles/sidebar-links.css +++ b/sites/.vitepress/devui-theme/styles/sidebar-links.css @@ -105,3 +105,14 @@ a.sidebar-link-item.active { font-size: 0.9rem; font-weight: 400; } + +.sidebar .sidebar-link-status { + display: inline-block; + min-height: 20px; + margin: 0 8px; + padding: 0 8px; + border: solid 1px #50d4ab; + border-radius: 2px; + color: #50d4ab; + font-size: 12px; +} \ No newline at end of file