0.1.4 • Published 3 years ago
numcaptcha-vue v0.1.4
Usage
In your vue app, install the plugin from npm as a dependency
npm i --save numcaptcha-vue
In 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
FontAwesomeIcon
andfas
as 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
status
with the value ofsuccess
when the user successfully completed numCaptcha or with the value offailed
when 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: