@carpenter/react-tencent-captcha

0.1.3 • Public • Published

@carpenter/react-tencent-captcha

安装

npm i @carpenter/react-tencent-captcha

引用

  import TencentCaptcha from '@carpenter/react-tencent-captcha';

属性

成员 说明 类型 默认值
onRefChild onRefChild function
appid appid String
callback 验证成功的回调函数 function
options 配置参数 object

示例

import TencentCaptcha from '@carpenter/react-tencent-captcha';

class Demo extends Component {

  captcha = null;

  onRefChild = ref => {
    this.captcha = ref;
  }

  captchaCallback = res => {
    console.log(res);
  }

  // 销毁
  destroy = () => {
    this.captcha.destroy();
  }

  render() {
    return <div>
      <TencentCaptcha
        appid="2028109764"
        callback={this.captchaCallback}
        onRefChild={this.onRefChild}
      >
        点我啊!
      </TencentCaptcha>
    </div>
  }
}

Package Sidebar

Install

npm i @carpenter/react-tencent-captcha

Weekly Downloads

23

Version

0.1.3

License

MIT

Unpacked Size

28.9 kB

Total Files

8

Last publish

Collaborators

  • carpenter