Skip to content

Commit 63ee587

Browse files
committed
fix(VerificationCode):增加VerificationCode验证码组件API
1 parent b586a31 commit 63ee587

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/core/src/VerificationCode/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ interface VerificationCodeProps {
3131
buttonStyle?: StyleProp<ViewStyle>;
3232
/**输入框空白时自定义展示 */
3333
placeholder?: string;
34+
/**是否展示输入框边框 */
35+
inputBorder?: boolean;
3436
}
3537

3638
const VerificationCode: FC<VerificationCodeProps> = ({
@@ -46,6 +48,7 @@ const VerificationCode: FC<VerificationCodeProps> = ({
4648
outerStyle = {},
4749
buttonStyle = {},
4850
placeholder = '请输入验证码',
51+
inputBorder = true,
4952
}) => {
5053
const [timer, setTimer] = useState(count);
5154
const [disabled, setDisabled] = useState(false);
@@ -75,7 +78,7 @@ const VerificationCode: FC<VerificationCodeProps> = ({
7578

7679
return (
7780
<Input
78-
border={null}
81+
border={inputBorder ? 'always' : null}
7982
containerStyle={[{ height: 40 }, outerStyle]}
8083
placeholder={placeholder}
8184
placeholderTextColor={theme.colors.border}
@@ -86,8 +89,9 @@ const VerificationCode: FC<VerificationCodeProps> = ({
8689
bordered={bordered}
8790
disabled={disabled}
8891
onPress={handleClick}
89-
color={theme.colors.background || '#fff'}
92+
color={theme.colors.background || 'transparent'}
9093
style={[buttonStyle]}
94+
size="small"
9195
>
9296
<Text color={disabled ? 'disabled' : 'text'}>{disabled ? `${resendLabel}(${timer}s)` : label}</Text>
9397
</Button>

0 commit comments

Comments
 (0)