美文网首页
Vue插件之滑动验证码

Vue插件之滑动验证码

作者: 小李不小 | 来源:发表于2021-11-19 11:15 被阅读0次

预览
目前仅前端实现,支持移动端滑动事件。版本V1.0.5


image.png

安装

npm install --save vue-monoplasty-slide-verify
使用方法
// main.js
import Vue from 'vue';
import SlideVerify from 'vue-monoplasty-slide-verify';

Vue.use(SlideVerify);
// template
<slide-verify :l="42"
            :r="10"
            :w="310"
            :h="155"
            @success="onSuccess"
            @fail="onFail"
            @refresh="onRefresh"
            :slider-text="text"
            ></slide-verify>
<div>{{msg}}</div>
// script
export default {
   name: 'App',
    data(){
        return {
            msg: '',
            text: '向右滑',
        }
    },
    methods: {
        onSuccess(){
            this.msg = 'login success'
        },
        onFail(){
            this.msg = ''
        },
        onRefresh(){
            this.msg = ''
        }
    }
}
image.png
image.png

相关文章

网友评论

      本文标题:Vue插件之滑动验证码

      本文链接:https://www.haomeiwen.com/subject/mtwniltx.html