diff --git a/db/TDesign.db b/db/TDesign.db index 19667691..5f9f2617 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-mobile-react/src/switch/defaultProps.ts b/packages/products/tdesign-mobile-react/src/switch/defaultProps.ts index 2c1432d1..d28cb443 100644 --- a/packages/products/tdesign-mobile-react/src/switch/defaultProps.ts +++ b/packages/products/tdesign-mobile-react/src/switch/defaultProps.ts @@ -4,10 +4,4 @@ import { TdSwitchProps } from './type'; -export const switchDefaultProps: TdSwitchProps = { - disabled: undefined, - icon: [], - label: [], - loading: false, - size: 'medium', -}; +export const switchDefaultProps: TdSwitchProps = { disabled: undefined, label: [], loading: false, size: 'medium' }; diff --git a/packages/products/tdesign-mobile-react/src/switch/switch.en-US.md b/packages/products/tdesign-mobile-react/src/switch/switch.en-US.md index f691a093..c1128a62 100644 --- a/packages/products/tdesign-mobile-react/src/switch/switch.en-US.md +++ b/packages/products/tdesign-mobile-react/src/switch/switch.en-US.md @@ -11,7 +11,6 @@ style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProper colors | Array | - | `deprecated`。Typescript:`string[]` | N customValue | Array | - | Typescript:`Array` | N disabled | Boolean | undefined | \- | N -icon | Array | [] | Typescript:`TNode[]`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N label | TNode | [] | Typescript:`Array \| TNode<{ value: SwitchValue }>`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N loading | Boolean | false | \- | N size | String | medium | options: small/medium/large | N diff --git a/packages/products/tdesign-mobile-react/src/switch/switch.md b/packages/products/tdesign-mobile-react/src/switch/switch.md index f36a6bf1..3a023f7d 100644 --- a/packages/products/tdesign-mobile-react/src/switch/switch.md +++ b/packages/products/tdesign-mobile-react/src/switch/switch.md @@ -11,7 +11,6 @@ style | Object | - | 样式,TS 类型:`React.CSSProperties` | N colors | Array | - | 已废弃。自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray]。TS 类型:`string[]` | N customValue | Array | - | 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close']。TS 类型:`Array` | N disabled | Boolean | undefined | 是否禁用组件。优先级:Switch.disabled > Form.disabled | N -icon | Array | [] | 开关的图标;[打开时的图标,关闭时的图标]。TS 类型:`TNode[]`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N label | TNode | [] | 开关内容,[开启时内容,关闭时内容]。示例:['开', '关'] 或 (value) => value ? '开' : '关'。TS 类型:`Array \| TNode<{ value: SwitchValue }>`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N loading | Boolean | false | 是否处于加载中状态 | N size | String | medium | 开关尺寸。可选项:small/medium/large | N diff --git a/packages/products/tdesign-mobile-react/src/switch/type.ts b/packages/products/tdesign-mobile-react/src/switch/type.ts index 9470c5e4..7a3fee96 100644 --- a/packages/products/tdesign-mobile-react/src/switch/type.ts +++ b/packages/products/tdesign-mobile-react/src/switch/type.ts @@ -16,11 +16,6 @@ export interface TdSwitchProps { * 是否禁用组件。优先级:Switch.disabled > Form.disabled */ disabled?: boolean; - /** - * 开关的图标;[打开时的图标,关闭时的图标] - * @default [] - */ - icon?: TNode[]; /** * 开关内容,[开启时内容,关闭时内容]。示例:['开', '关'] 或 (value) => value ? '开' : '关' * @default [] @@ -47,7 +42,7 @@ export interface TdSwitchProps { /** * 数据发生变化时触发 */ - onChange?: (value: T, context: { e: MouseEvent }) => void; + onChange?: (value: T, context: { e: MouseEvent }) => void; } export type SwitchValue = string | number | boolean; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 271744b9..9dc93bb2 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -109951,7 +109951,6 @@ "id": 3424, "platform_framework": [ "8", - "16", "32" ], "component": "Switch", @@ -109981,7 +109980,6 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)", "Angular(Mobile)" ], "field_type_text": [ @@ -110271,10 +110269,7 @@ "platform_framework": [ "1", "2", - "4", - "8", - "16", - "32" + "4" ], "component": "Switch", "field_category": 2, @@ -110304,10 +110299,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Angular(PC)", - "Vue(Mobile)", - "React(Mobile)", - "Angular(Mobile)" + "Angular(PC)" ], "field_type_text": [ "Boolean" @@ -110350,6 +110342,45 @@ "Boolean" ] }, + { + "id": 1726808201, + "platform_framework": [ + "8", + "16" + ], + "component": "Switch", + "field_category": 2, + "field_name": "change", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "数据发生变化时触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "(value: T, context: { e: MouseEvent })", + "create_time": "2024-09-20 04:56:41", + "update_time": "2024-09-20 04:56:41", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "Vue(Mobile)", + "React(Mobile)" + ], + "field_type_text": [ + "Boolean" + ] + }, { "id": 3341, "platform_framework": [