fix(Switch): incorrect size prop type (#5229)

This commit is contained in:
neverland 2019-12-09 17:36:22 +08:00 committed by GitHub
parent 308c0a9a92
commit 41824d7afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ use `loading` property to keep component in loading state
| cell-size | Cell sizecan 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` | - |

View File

@ -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` | - |

View File

@ -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,