Google ReCAPTCHA component for Vue.js
Notice: The document on github is always reference to master branch. For stable version, please read the document at NPM.
Google ReCAPTCHA component for vue. If you like this package, please leave a star on github.
This version is for Vue 2.0. If you need Vue 1.x support please reference to vue-v1.x.
Notice: This project currently not supporting reCAPTCHA v3.
$ npm install --save vue-recaptcha
Place this in head to load reCAPTCHA:
With `onload` callback, it will notify us when the api is ready for use.
vue-recaptchain your app.
Notice: You could only place one element as
For more information, please reference to example
loadRecaptchaScriptprops is set to
true, vue-recaptcha will inject the required tag. This means that manually placing the tag is unneccessary.
loadRecaptchaScriptis set to
true, vue-recaptcha will inject the required tag Default:
The following props will only work when
loadRecaptchaScriptis set as
// user browser language by default
responseis the successful reCAPTCHA response
idis the widget id of the component
It's because google's recaptcha have been loaded before your app. You can simply ignore it because vue-recaptcha can still detect and render recaptcha. If you care about this, try to move the script tag of recatpcha after to your app.
You can mock
window.grecaptchato bypass google's recaptcha. Here is an example which work with jest.
Please refernece to recaptcha's faq.