Skip to content

Commit

Permalink
docs(SideBar): sync api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Sep 3, 2024
1 parent d36742e commit 5d5efaa
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/side-bar-item/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const props: TdSideBarItemProps = {
type: Boolean,
value: false,
},
/* 图标,传对象则透传至 Icon */
/** 图标,传对象则透传至 Icon */
icon: {
type: null,
},
Expand Down
5 changes: 4 additions & 1 deletion src/side-bar-item/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { BadgeProps } from '../badge/index';

export interface TdSideBarItemProps {
/**
* 透传至 Badge 组件
*/
badgeProps?: {
type: ObjectConstructor;
value?: object;
value?: BadgeProps;
};
/**
* 是否禁用
Expand All @@ -25,6 +27,7 @@ export interface TdSideBarItemProps {
*/
icon?: {
type: null;
value?: string | object;
};
/**
* 展示的标签
Expand Down
14 changes: 10 additions & 4 deletions src/side-bar/README.en-US.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
:: BASE_DOC ::

## API

### SideBar Props

name | type | default | description | required
-- | -- | -- | -- | --
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
value | String / Number | - | \- | N
default-value | String / Number | undefined | uncontrolled property | N

Expand All @@ -15,18 +18,21 @@ name | params | description
change | `(value: number \| string, label: string)` | \-
click | `(value: number \| string, label: string)` | \-


### SideBarItem Props

name | type | default | description | required
-- | -- | -- | -- | --
badge-props | Object | - | \- | N
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
badge-props | Object | - | Typescript:`BadgeProps`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/side-bar-item/type.ts) | N
disabled | Boolean | false | \- | N
icon | String / Object | - | `1.0.0-rc.1` | N
icon | String / Object | - | \- | N
label | String | - | \- | N
value | String / Number | - | \- | N


### CSS Variables

The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
-- | -- | --
Expand All @@ -41,4 +47,4 @@ Name | Default Value | Description
--td-side-bar-font-size | 32rpx | -
--td-side-bar-icon-size | 40rpx | -
--td-side-bar-item-height | 112rpx | -
--td-side-bar-item-line-height | 48rpx | -
--td-side-bar-item-line-height | 48rpx | -
18 changes: 12 additions & 6 deletions src/side-bar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ isComponent: true
{{ custom }}

## API

### SideBar Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
value | String / Number | - | 选项值 | N
default-value | String / Number | undefined | 选项值。非受控属性 | N

Expand All @@ -64,18 +67,21 @@ default-value | String / Number | undefined | 选项值。非受控属性 | N
change | `(value: number \| string, label: string)` | 选项值发生变化时触发
click | `(value: number \| string, label: string)` | 点击选项时触发


### SideBarItem Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
badge-props | Object | - | 透传至 Badge 组件 | N
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
badge-props | Object | - | 透传至 Badge 组件。TS 类型:`BadgeProps`[Badge API Documents](./badge?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/side-bar-item/type.ts) | N
disabled | Boolean | false | 是否禁用 | N
icon | String / Object | - | `1.0.0-rc.1`图标,传对象则透传至 Icon | N
icon | String / Object | - | 图标,传对象则透传至 Icon | N
label | String | - | 展示的标签 | N
value | String / Number | - | 当前选项的值 | N

### CSS Variables

### CSS 变量
组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
Expand All @@ -90,4 +96,4 @@ value | String / Number | - | 当前选项的值 | N
--td-side-bar-font-size | 32rpx | -
--td-side-bar-icon-size | 40rpx | -
--td-side-bar-item-height | 112rpx | -
--td-side-bar-item-line-height | 48rpx | -
--td-side-bar-item-line-height | 48rpx | -

0 comments on commit 5d5efaa

Please sign in to comment.