1.1.0 • Published 4 years ago

su-vue-slide-verify v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

使用手册

安装

使用以下命令安装这个包:

npm install --save su-vue-slide-verify

参数配置

参数名称说明
是否可见visibletrue/false,默认true
图片路径数组imgs例如:'/static/imgs/1.jpg','/static/imgs/2.jpg'

事件

事件名称说明
成功success验证成功后的回调函数
失败error验证失败后的回调函数

例子

在入口文件src/main.js中全局引入

import verify from 'su-vue-slide-verify';
Vue.use(verify)

在需要的界面中使用

<template>
    <verify :imgs="imgs"
            :visible="visible"
            @success="handleSuccess"
            @error="handleError">
    </verify>
</template>
export default{
	data(){
		return {
			imgs:[],//图片路径数组
			visible:true,//滑动验证模块是否可见
		}
	},
	created(){
		for(let i = 1;i <= 10;i++){
			this.imgs.push(`static/imgs/pic${i}.jpg`);
		}
    },
	methods:{
		handleSuccess(){
			alert("验证成功");
			this.visible = false;
		},
		handleError(){
			alert("验证失败");
		}
	}
}

如有建议,欢迎联系我一起进行交流

由 meishishang (邮箱:meishishang@outlook.com)创建

1.1.0

4 years ago

1.0.0

4 years ago