Giter Site home page Giter Site logo

react-slide-verify's Introduction

说明

此插件是通过vue的一个轮子改造成的react版本,若有侵权,请告知删除。

原vue插件链接:基于滑动式的验证码,免于字母验证码的繁琐输入 用于网页注册或者登录

安装

$ npm install react-slide-verify --save-dev

使用

import ReactSlideVerify from 'react-slide-verify';

onSuccess = () => {
    console.log('成功回调');
}

onFail = () => {
    console.log('失败回调');
}

onRefresh = () => {
    console.log('刷新')
}
<ReactSlideVerify
    l={40}
    r={8}
    w={310}
    h={155}
    accuracy={5}
    imgs={[img1, img2, img3, img4, img5]}
    sliderText="向右滑动"
    success={this.onSuccess}
    fail={this.onFail}
    refresh={this.onRefresh}
/>

参数说明

属性/方法 说明 类型 默认值 是否必传
l 滑块大小 number --
r 滑块突起大小 number --
w 画布宽度 number --
h 画布高度 number --
accuracy 匹配精确度 number 5
imgs 画布背景图 string[] --
sliderText 底部拖动条文字说明 string 向右滑动
success 匹配成功回调函数,返回滑动开始到结束时间time Function(time) --
fail 匹配失败回调函数 Function() --
refresh 刷新画布回调函数 Function() --

react-slide-verify's People

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.