feat(Switch): support number type of size prop (#4913)

This commit is contained in:
neverland
2019-11-04 17:29:56 +08:00
committed by GitHub
parent 7948b59063
commit 9ace3320b8
5 changed files with 20 additions and 4 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { createNamespace } from '../utils';
import { createNamespace, addUnit } from '../utils';
import { BLUE, GRAY_DARK } from '../utils/constant';
import { switchProps, SharedSwitchProps } from './shared';
import { emit, inherit } from '../utils/functional';
@@ -34,7 +34,7 @@ function Switch(
const checked = value === activeValue;
const switchStyle = {
fontSize: size,
fontSize: addUnit(size),
backgroundColor: checked ? activeColor : inactiveColor
};