slider_ccaptcha_vue_fhlt
v1.0.6
Published
slider captcha for vue
Downloads
3
Readme
滑块式验证码 vue插件
快速开始
npm安装
npm i slider_ccaptcha_vue_fhlt
引入组件
<script>
import sliderCaptcha from 'slider_ccaptcha_vue_fhlt/captcha.vue'
export default {
components: {
sliderCaptcha
},
...
}
</script>
配置appkey
<script>
data() {
return {
appkey: 'qscms',
}
},
</script>
使用
<template>
<view class="content">
<button @click="open">打开验证</button>
<captcha ref="captcha" appkey="qscms" closeable closeOnClickOverlay :channelText="'滑动完成验证'" endToStart>
</captcha>
</view>
</template>
method
methods: {
open() {
this.$refs.captcha.show(res=>{
if(res.code==200){
uni.showToast({
title: '验证通过' + res.data.ticket,
duration: 2000
});
}
});
}
...
}
示例
<template>
<view class="content">
<captcha ref="captcha" appkey="qscms" closeable closeOnClickOverlay :channelText="'滑动完成验证'" endToStart>
</captcha>
</view>
</template>
<script>
import sliderCaptcha from 'slider_ccaptcha_vue_fhlt/captcha.vue'
export default {
components: {
sliderCaptcha
},
data() {
return {
appkey: 'qscms',
}
},
onLoad() {
},
methods: {
open() {
this.$refs.captcha.show(res=>{
if(res.code==200){
uni.showToast({
title: '验证通过' + res.data.ticket,
duration: 2000
});
}
});
}
}
}
</script>