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

feat(Picker): add keys props #551

Merged
merged 1 commit into from
Feb 13, 2025
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
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cancelBtn | String / Boolean | true | Typescript:`boolean \| string` | N
columns | Array / Function | [] | required。Typescript:`PickerColumn \| Array<PickerColumn> \| ((item: Array<PickerValue>) => Array<PickerColumn>)` `type PickerColumn = PickerColumnItem[]` `interface PickerColumnItem { label: string,value: string}`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | Y
confirmBtn | String / Boolean | true | Typescript:`boolean \| string` | N
header | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
option | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
renderLabel | Function | - | Typescript:`(item: PickerColumnItem) => string` | N
title | String | '' | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cancelBtn | String / Boolean | true | 取消按钮文字。TS 类型:`boolean
columns | Array / Function | [] | 必需。配置每一列的选项。TS 类型:`PickerColumn \| Array<PickerColumn> \| ((item: Array<PickerValue>) => Array<PickerColumn>)` `type PickerColumn = PickerColumnItem[]` `interface PickerColumnItem { label: string,value: string}`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | Y
confirmBtn | String / Boolean | true | 确定按钮文字。TS 类型:`boolean \| string` | N
header | Slot / Function | - | 自定义头部内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
keys | Object | - | 用来定义 value / label / disabled 在 `columns ` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
option | Slot / Function | - | 自定义选项内容。参数为 `option: PickerColumnItem, index: number`。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
renderLabel | Function | - | 自定义label。TS 类型:`(item: PickerColumnItem) => string` | N
title | String | '' | 标题 | N
Expand Down
4 changes: 4 additions & 0 deletions packages/products/tdesign-mobile-vue/src/picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default {
header: {
type: Function as PropType<TdPickerProps['header']>,
},
/** 用来定义 value / label / disabled 在 `columns ` 中对应的字段别名 */
keys: {
type: Object as PropType<TdPickerProps['keys']>,
},
/** 自定义选项内容。参数为 `option: PickerColumnItem, index: number` */
option: {
type: Function as PropType<TdPickerProps['option']>,
Expand Down
6 changes: 5 additions & 1 deletion packages/products/tdesign-mobile-vue/src/picker/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode } from '../common';
import { TNode, KeysType } from '../common';

export interface TdPickerProps {
/**
Expand All @@ -26,6 +26,10 @@ export interface TdPickerProps {
* 自定义头部内容
*/
header?: TNode;
/**
* 用来定义 value / label / disabled 在 `columns ` 中对应的字段别名
*/
keys?: KeysType;
/**
* 自定义选项内容。参数为 `option: PickerColumnItem, index: number`
*/
Expand Down
37 changes: 37 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -80211,6 +80211,43 @@
"Object"
]
},
{
"id": 1739442023,
"platform_framework": [
"8"
],
"component": "Picker",
"field_category": 1,
"field_name": "keys",
"field_type": [
"8"
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "用来定义 value / label / disabled 在 `columns ` 中对应的字段别名",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2025-02-13 10:20:23",
"update_time": "2025-02-13 10:20:23",
"event_output": null,
"custom_field_type": "KeysType",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
],
"field_type_text": [
"Object"
]
},
{
"id": 1729074658,
"platform_framework": [
Expand Down