1.0.1 • Published 5 years ago

react-yunpian-captcha v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

react-yunpian-captcha

A YunPian Captcha component for React

Installation

$ npm install --save react-yunpian-captcha

Usage

import YunPianCaptcha from 'react-yunpian-captcha';

export default () => {
  const onSuccess = (validInfo, close) => console.log(validInfo) || close();

  return (
    <YunPianCaptcha
      appId="your-appId"
      version="v1"
      onSuccess={onSuccess}
    />
  );
};

Properties

  className:    PropTypes.string,
  onSuccess:    PropTypes.func.isRequired,
  onFail:       PropTypes.func,
  onExit:       PropTypes.func,
  beforeStart:  PropTypes.func,
  afterStart:   PropTypes.func,
  expired:      PropTypes.number,
  jsonpField:   PropTypes.string,
  rsaPublicKey: PropTypes.string,
  hosts:        PropTypes.string,
  appId:        PropTypes.string.isRequired,
  version:      PropTypes.string.isRequired,
  noButton:     PropTypes.bool,
  mode:         PropTypes.string,
  winWidth:     PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  lang:         PropTypes.oneOf(['zh-cn', 'en']),
  langPack:     PropTypes.object,

Read More

License

MIT