0.1.4 • Published 5 years ago
numcaptcha-vue v0.1.4
Usage
In your vue app, install the plugin from npm as a dependency
npm i --save numcaptcha-vueIn your main.js, call the Vue.use() global method to use the plugin.
:warning: numCaptchaVUE uses Font Awesome icons hence please install the neccessary packages. Also, do remember to pass
FontAwesomeIconandfasas options into the plugin.
// firstly, import and use Font Awesome
import { library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
library.add(fas);
Vue.component('font-awesome-icon', FontAwesomeIcon);
// then, import and use numCaptcha
import NumCaptcha from 'numcaptcha-vue';
Vue.use(NumCaptcha, { FontAwesomeIcon, fas });
/* ... rest of main.js ... */After importing the plugin, you can use it anywhere in your vue application using the <num-captcha /> component.
The component emits an event called
statuswith the value ofsuccesswhen the user successfully completed numCaptcha or with the value offailedwhen the user is identified as a bot
<num-captcha @status="success | failed" />Dependencies
Others numCAPTCHA Libraries...
If you are using plain Javascript, do check out numCaptchaJS :tada: