You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

amis-sms-code-renderer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amis-sms-code-renderer

```bash yarn add amis-sms-code-control ```

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source
yarn add amis-sms-code-control

载入组件

import 'amis-sms-code-control';

自定义

import { FormItem } from 'amis';
import { SmsCodeControl } from 'amis-sms-code-control';

@FormItem({
  type: 'custom-sms-code',
})
class CustomSmsCodeControl extends SmsCodeControl {
  // 自定义代码
}

配置

{
  type: 'form',
  controls: [
    {
      "type": "text",
      "name": "phone",
      "required": true,
      "validations": "isPhoneNumber",
      "placeholder": "请输入手机",
      "label": "手机",
    },
    {
      "type": "sms-code",
      "label": '验证码',
      "placeholder": "请输入验证码",
      "name": "code",
      "phoneField": "phone", // 与填写手机的字段 name 对应
      "api": {
        "method": "post",
        "url": "/code",
        "data": {
          "phone": "${phone}" // 与填写手机的字段 name 对应
        },
      },
      "validations": {
        isNumeric: true,
        isLength: 6
      },
      "required": true,
    },
  ]
}

FAQs

Package last updated on 08 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts