From 41824d7afafd8ed1b95124963804037b1c1e64b5 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 9 Dec 2019 17:36:22 +0800 Subject: [PATCH] fix(Switch): incorrect size prop type (#5229) --- src/switch-cell/README.md | 2 +- src/switch-cell/README.zh-CN.md | 2 +- src/switch/shared.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/switch-cell/README.md b/src/switch-cell/README.md index 12dd7b22e..e9631f361 100644 --- a/src/switch-cell/README.md +++ b/src/switch-cell/README.md @@ -65,7 +65,7 @@ use `loading` property to keep component in loading state | cell-size | Cell size,can be set to `large` | *string* | - | - | | loading | whether switch is loading | *boolean* | `false` | - | | disabled | whether to disable switch | *boolean* | `false` | - | -| size | Size of switch | *string* | `24px` | - | +| size | Size of switch | *string \| number* | `24px` | - | | active-color | Background of switch color when active | *string* | `#1989fa` | - | | inactive-color | Background of switch color when inactive | *string* | `#fff` | - | | active-value | Value when active | *any* | `true` | - | diff --git a/src/switch-cell/README.zh-CN.md b/src/switch-cell/README.zh-CN.md index 9a1e431ac..2ccfeb728 100644 --- a/src/switch-cell/README.zh-CN.md +++ b/src/switch-cell/README.zh-CN.md @@ -65,7 +65,7 @@ export default { | cell-size | 单元格大小,可选值为 `large` | *string* | - | | loading | 是否为加载状态 | *boolean* | `false` | - | | disabled | 是否为禁用状态 | *boolean* | `false` | - | -| size | 开关尺寸 | *string* | `24px` | - | +| size | 开关尺寸 | *string \| number* | `24px` | - | | active-color | 开关时的背景色 | *string* | `#1989fa` | - | | inactive-color | 开关时的背景色 | *string* | `#fff` | - | | active-value | 打开时的值 | *any* | `true` | - | diff --git a/src/switch/shared.ts b/src/switch/shared.ts index 8ee1b375b..84c46eb97 100644 --- a/src/switch/shared.ts +++ b/src/switch/shared.ts @@ -3,7 +3,7 @@ */ export type SharedSwitchProps = { - size: string; + size?: string | number; value?: any; loading?: boolean; disabled?: boolean; @@ -14,7 +14,7 @@ export type SharedSwitchProps = { }; export const switchProps = { - size: String, + size: [String, Number], value: null as any, loading: Boolean, disabled: Boolean,