damoguyan11 / vue-monoplasty-slide-verify

vue slide verify online preview

Home Page:https://monoplasty.github.io/vue-monoplasty-slide-verify/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-monoplasty-slide-verify

A Vue plugin to slide verify Demo

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

Quick Start

1. Import vue-monoplasty-slide-verify into your vue.js project.

Using build tools:

npm install --save vue-monoplasty-slide-verify
import Vue from 'vue';
import SlideVerify from 'vue-monoplasty-slide-verify';

Vue.use(SlideVerify);

2. Now you have it. The simplest usage:

<slide-verify :l="42"
            :r="10"
            :w="310"
            :h="155"
            @success="onSuccess"
            @fail="onFail"
            @refresh="onRefresh"
            ></slide-verify>
<div>{{msg}}</div>
export default {
        name: 'App',
        data(){
            return {
                msg: '',
            }
        },
        methods: {
            onSuccess(){
                this.msg = 'login success'
            },
            onFail(){
                this.msg = ''
            },
            onRefresh(){
                this.msg = ''
            }
        }
    }

Document

argument

Param Type Describe
l Number block length
r Number block circle radius
w Number canvas width
h Number canvas height

callBack

Event Type Describe
success Function success callback
fail Function fail callback
refresh Function refresh button callback

For detailed explanation on how things work, consult the docs for vue-loader.

About

vue slide verify online preview

https://monoplasty.github.io/vue-monoplasty-slide-verify/


Languages

Language:Vue 83.5%Language:JavaScript 14.7%Language:HTML 1.8%