1.2.0 • Published 6 years ago

@finpo/vue2-recaptcha-invisible v1.2.0

Weekly downloads
201
License
-
Repository
github
Last release
6 years ago

vue2-recaptcha-invisible

vue.js 2 component for google reCAPTCHA invisible

how to install

npm

npm install @finpo/vue2-recaptcha-invisible --save

yarn

yarn add @finpo/vue2-recaptcha-invisible

how to use

with webpack

<template>
<section>
  <g-recaptcha 
    data-sitekey="6LdTpxUUAAAAAG6L89kxRvjMdP0XDAyUji8rtQxw" 
    :data-validate="validate"
    :data-callback="callback"
  >Submit form
  </g-recaptcha>
  <!-- g-recaptcha will replace a button for submit form -->
</section>
</template>
<script>
import gRecaptcha from '@finpo/vue2-recaptcha-invisible';
export default {
  components: {
    gRecaptcha,
  },
  methods: {
    validate() {
      // validate your form , if you don't have validate prop , default validate pass .
      return true;
    },
    callback(token) {
      // google recaptcha token , then you can pass to backend with your form data .
      if (token) {
        alert(token);
      }else{
        // if you use data-size show reCAPTCHA , maybe you will get empty token.
        alert('please check you are not robot');
      }
    },
  },
}
</script>

with web

mount dist/vue2-recaptcha-invisible.min.js will install componet to vue global.

props

proptypedesc
data-sitekeyStringyour front-end api key from google
data-callbackFunctionreceive google reCAPTCHA response token
data-validateFunctionyou can validate your form before get token ( only validate return true )
data-badgeStringbottomright(default) , bottomleft , inline
data-typeStringaudio , image(default)
data-tabindexString0
data-sizeif you want show reCAPTCHA (I'm not robot chekcbox) on screen , add this attribute
data-btn-classString,Array,Objectbind class on button
data-btn-disabledBooleanbind disabled prop on button
data-languageStringreCAPTCHA languageauto detect by defualtLanguage codes

online demo

demo

refactor to rollup

support sfc, esm, umd, unpkg format. vue-sfc-rollup

1.2.0

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago