Module: SMSInput

短信验证码组件
Properties:
Name Type Description
props Object 组件属性,内容如下
Properties
Name Type Description
value String
second String 倒计时(单位秒)
onSendMessage String 发送短信事件
onChange String 值改变事件

Examples

组件引入

// 全局模块引入
import { SMSInput } from '@ccreator/smart-ui';
// 最小化模块引入
import SMSInput from '@ccreator/smart-ui/dist/SMSInput';

使用示例

<SMSInput
    value={form.smscode}
    onSendMessage={(success, error) => {
        fetch(`/sendsms/${mobile}`).then(success).catch((err) => {
            // todo handle err
            error();
        });
    }}
    onChange={(value) => {
        setForm({ ...form, smscode: value });
    }}
/>