@appsbd/vue3-recaptcha

1.0.3 • Public • Published

Vue3 reCaptcha v3

Install :

npm i @appsbd/vue3-recaptcha

Use

<recaptcha ref="mrecaptcha" :site-key="your_site_key" />  

Get Token

var token = await this.$refs.mrecaptcha.getToken();    

Full Example :

<template>
  <div id="app">    
    <recaptcha ref="mrecaptcha" 
    :site-key="site_key" 
    :hide-badge="hide_badge"/>          
    
    <button type="button" 
    @click=" this.hide_badge = !this.hide_badge;">Hide badge</button>
    
    <button type="button" 
    @click="submit">Submit</button> 
  </div>
</template>
<script>
import { defineComponent } from 'vue';
import recaptcha from '@appsbd/vue3-recaptcha';   

export default defineComponent({
  name: 'App',
  components: {
    recaptcha
  },
  data() {
    return {
      site_key:'your_site_key_here',
      hide_badge:false
    }
  },     
  methods: {       
    async submit() {
      var token = await this.$refs.mrecaptcha.getToken();
      console.log(token);          
    }
  }
});
</script>

Any Issue or Suggestion, please contact :

hello@appsbd.com

https://appsbd.com

Dependents (0)

Package Sidebar

Install

npm i @appsbd/vue3-recaptcha

Weekly Downloads

10

Version

1.0.3

License

none

Unpacked Size

13.2 kB

Total Files

5

Last publish

Collaborators

  • sarwarcse