Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(picker): enrich api detail #1956

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/picker/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ name | type | default | description | required
auto-close | Boolean | true | \- | N
cancel-btn | String / Boolean / Object | true | Typescript:`boolean \| string \| ButtonProps` | N
confirm-btn | String / Boolean / Object | true | Typescript:`boolean \| string \| ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
footer | Slot | - | `deprecated` | N
header | Boolean / Slot | true | \- | N
keys | Object | - | Typescript:`KeysType` | N
header | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
title | String | '' | \- | N
value | Array | - | Typescript:`Array<PickerValue>` `type PickerValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
default-value | Array | undefined | uncontrolled property。Typescript:`Array<PickerValue>` `type PickerValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
Expand Down
5 changes: 3 additions & 2 deletions src/picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ isComponent: true
## 代码演示

### 组件类型

#### 基础选择器

单项和多选选择
Expand Down Expand Up @@ -47,8 +48,8 @@ auto-close | Boolean | true | 自动关闭;在确认、取消、点击遮罩
cancel-btn | String / Boolean / Object | true | 取消按钮文字。TS 类型:`boolean \| string \| ButtonProps` | N
confirm-btn | String / Boolean / Object | true | 确定按钮文字。TS 类型:`boolean \| string \| ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
footer | Slot | - | 已废弃。底部内容 | N
header | Boolean / Slot | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容 | N
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType` | N
header | Boolean / Slot | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
title | String | '' | 标题 | N
value | Array | - | 选中值。TS 类型:`Array<PickerValue>` `type PickerValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
default-value | Array | undefined | 选中值。非受控属性。TS 类型:`Array<PickerValue>` `type PickerValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/picker/type.ts) | N
Expand Down
2 changes: 1 addition & 1 deletion src/picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const props: TdPickerProps = {
type: null,
value: true,
},
/** 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容 */
/** 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容 */
header: {
type: Boolean,
value: true,
Expand Down
9 changes: 1 addition & 8 deletions src/picker/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface TdPickerProps {
value?: boolean | string | ButtonProps;
};
/**
* 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容
* 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容
* @default true
*/
header?: {
Expand Down Expand Up @@ -79,11 +79,4 @@ export interface TdPickerProps {
};
}

export type PickerColumn = PickerColumnItem[];

export interface PickerColumnItem {
label: string;
value: string;
}

export type PickerValue = string | number;