vue2-recaptchav3

VueJs Google Recaptcha V3
3,118 2
Install
npm install vue2-recaptchav3
Latest Version:1.0.7
Vue:2
License:MIT
Last Updated:Dec 31, 2022
Links: GitHub  ·  npm
Maintainer: giuga

Vue2 Google Recaptcha V3

Usage in form:

<form>
<input type="hidden" name="token" v-model="googleToken" />
<GoogleCaptcha sitekey="yourSiteKey" action="yourPageAction" v-on:google_captcha_token="updateToken" ref="captcha"></GoogleCaptcha>
</form>

Import statement and event handling:

<script>
import GoogleCaptcha from 'vue2-recaptchav3';
export default {
    data(){
        return {
            googleToken: null,
            ...
        }
    },
    methods: {
        updateToken(payload){
          this.googleToken = payload.response_token;
        },
        formSubmit(){
            this.$refs.captcha.generateManualToken().then((token) => {
                //use token here
            });
        }
        ...
    }
}
</script>

Every time the action changes a new token is generated.

This allows you to generate tokens based on the page the user is on or based on each individual form

Related Packages

vue-invisible-recaptcha

Simple component to integrate Invisible Recaptcha

10,088
@finpo/vue2-recaptcha-invisible

vue.js 2 component for google recaptcha invisible

8,811 25
oeos-v3-components

1. 在vue3项目的main.js里引入

5,727 1
vue-grecaptcha

Google Recaptcha for VueJS

2,344 26
vue-recaptcha-eh

Using recaptcha in Vue app

1,053 0

Version History

Version Released Vue License
1.0.7 ^2.6.10 MIT
1.0.6 ^2.6.10 MIT
1.0.5 ^2.6.10 MIT
1.0.4 ^2.6.10 MIT
1.0.3 ^2.6.10 MIT