vue-nocaptcha
Vue-nocaptcha (vue-nocaptcha)
Aliyun No-Captcha on Vue.
Vue上的Aliyun No-Captcha。
这是做什么的 (What this do)
Use Aliyun noCAPTCHA in Vue
在Vue中使用Aliyun noCAPTCHA
Use noCAPTCHA locally, load fast!
在本地使用noCAPTCHA,加载速度快!
Support both Desktop and H5 noCAPTCHA
同时支持台式机和H5 noCAPTCHA
Support full https request
支持完整的https请求
Support language switch
支持语言切换
安装 (Install)
npm install vue-nocaptcha版 (Version)
NOTE: Please Keep Update this plugin to maintain nc.js and nch5.js files fresh
注意:请保持更新此插件以保持nc.js和nch5.js文件新鲜
there's 3 versions of Vue-noCAPTCHA now.
现在有3个版本的Vue-noCAPTCHA。
full version (support both desktop and H5)
完整版(同时支持台式机和H5)
// import { nocaptcha } from 'vue-nocaptcha'
import nocaptcha from 'vue-nocaptcha/nocaptcha.js'
export default {
components: {
nocaptcha
}
}And,
和,
single desktop version
单桌面版
import nocaptcha from 'vue-nocaptcha/nocaptcha_pc.js'
export default {
components: {
nocaptcha
}
}single H5 version
单个H5版本
import nocaptcha from 'vue-nocaptcha/nocaptcha_h5.js'
export default {
components: {
nocaptcha
}
}用法 (Usage)
base usage
基本用法
<nocaptcha
:appkey="'FFFF00000000016AB730'"
:scene="'test'"
@callback="getToken"
></nocaptcha>desktop and h5 set
台式机和H5套装
<nocaptcha
:appkey="{
pc: 'FFFF00000000016AB730',
h5: 'FFFF00000000016AB730'
}"
:scene="{
pc: 'test',
h5: 'h5test'
}"
@callback="getToken"
></nocaptcha>as component (suggest)
作为组成部分(建议)
import { nocaptcha } from 'vue-nocaptcha'
export default {
components: {
nocaptcha
}
}as global component
作为全球组成部分
import Vue from 'vue'
import nocaptcha from 'vue-nocaptcha'
Vue.use(nocaptcha)pc/h5 version control
pc / h5版本控制
Normally, it can be control automatic.
通常,它可以是自动控制的。
Maybe, you need control it yourself.
也许您需要自己控制它。
<nocaptcha
:h5="isMobile()"
></nocaptcha>NOTE: no h5 prop in single PC/H5 version
注意:在单个PC / H5版本中没有h5道具
更多 (more)
use https
使用https
<nocaptcha
https
></nocaptcha>use oversea CDN
使用海外CDN
<nocaptcha
aeis
></nocaptcha>use lang
使用lang
<nocaptcha
lang="'vi_VN'"
></nocaptcha>events
大事记
<nocaptcha
@load="onLoad"
@callback="onSuccess"
@error="onError"
></nocaptcha>翻译自: https://vuejsexamples.com/aliyun-nocaptcha-component-for-vue-js/
vue-nocaptcha