短信验证码组件
Properties:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object | 组件属性,内容如下
Properties
|
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 });
}}
/>