Skip to content

pi0/vue-recaptcha

 
 

Repository files navigation

vue-recaptcha

Greenkeeper badge devDependencies Status peerDependencies Status CircleCI npm version npm downloads

Description

Google ReCAPTCHA component for vue.

This version is for Vue 2.0. If you need Vue 1.x support please reference to vue-v1.x.

Install

NPM

$ npm install vue-recaptcha

CDN

<script src="https://unpkg.com/vue-recaptcha@latest/dist/vue-recaptcha.js"></script>
<!-- Minify -->
<script src="https://unpkg.com/vue-recaptcha@latest/dist/vue-recaptcha.min.js"></script>

Usage

Place this in head to load recaptcha:

<script src="https://www.google.com/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit" async defer>
</script>
With `onload` callback, it will notify us when the api is ready for use.

Then use it in your component

<template>
  <vue-recaptcha sitekey="Your key here"></vue-recaptcha>
</template>

<script>
  import VueRecaptcha from 'vue-recaptcha';
  export default {
    ...
    components: { VueRecaptcha }
  };
</script>

For more information, please reference to example

API

Props

  • sitekey (required)
    ReCAPTCHA site key
  • options (optional)
    Any options for Google ReCAPTCHA, please reference to ReCAPTCHA document.
    Notice: callback and expired-callback will be override by component for emit event.

Methods

  • reset
    Reset ReCAPTCHA instance

Events

  • recaptchaReset Reset ReCAPTCHA instance

About

Google ReCAPTCHA component for Vue.js

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • JavaScript 94.1%
  • HTML 5.9%