vue 行为验证码之滑动验证AJ-Captcha使用详解(vue滑块验证插件)满满干货

随心笔谈1年前 (2023)发布 admin
135 0

<template>
<Verify
@success=”success” //验证成功的回调函数
:mode=”pop” //调用的模式
:captchaType=”blockPuzzle” //调用的类型 点选或者滑动
:imgSize=”{ width: ‘330px’, height: ‘155px’ }” //图片的大小对象
ref=”verify”
></Verify>
//mode=”pop”模式
<button @click=”useVerify”>调用验证组件</button>
</template>
****注: mode为”pop”时,使用组件需要给组件添加ref值,并且手动调用show方法 例: this.$refs.verify.show()****
****注: mode为”fixed”时,无需添加ref值,无需调用show()方法****
<script>
//引入组件
import Verify from “https://www.jb51.net/javascript//components/verifition/Verify”;
export default {
name: ‘app’,
components: {
Verify
}
methods:{
success(params){
// params 返回的二次验证参数, 和登录参数一起回传给登录接口,方便后台进行二次验证
},
useVerify(){
this.$refs.verify.show()
}
}
}
</script>

© 版权声明

相关文章