Coder Social home page Coder Social logo

vue3-recaptcha2's People

Contributors

bbonch avatar jkeys089 avatar khareemnurulla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue3-recaptcha2's Issues

reCAPTCHA placeholder element must be an element or id

I'm getting the following error when using the component:

Uncaught (in promise) Error: reCAPTCHA placeholder element must be an element or id
    r recaptcha__en.js:313
    renderRecaptcha index.js:46
    beforeMount index.js:74
recaptcha__en.js:313:258

It seems grecaptcha.render won't accept this.$refs.recaptcha as its first parameter.

Recaptcha div added to HTML is not removed

I observe that for every instantiation of the component, there's a

add to the app HTML at the bottom. Rightfully this should be removed when the page where captcha component is unmounted.

This is a sample screenshot of this div:
image

Looking at your code, this element seems to be created by Google's captcha JS. Perhaps there's a call that you need to make to remove this element during component unmount.

[Bug] render is not a function

Describe the bug
When I load the page in vue v3, I may get an error in the console stating that "window.grecaptcha.render is not a function" and i can't get token from captcha

My Environment

OC: Windows 10
Library: Vue JS v3 with class component
Browser: Chrome, Edge

To Reproduce
Steps to reproduce the behavior:

  1. install library with npm
  2. add script for grecaptcha
  3. reproduce example from Readme.md in class component
  4. run npm run serve and open in browser
  5. open console

Expected behavior:
getting token and recaptcha icon showing

this.$refs.recaptcha could be null

If the window.grecaptcha is not null, the $refs.recaptach in the renderRecaptcha function will not work because we are in the context of "BeforeMount", so the component is not mounted.

You could add a setTimeout in the renderRecaptcha to wait the next frame in this case

The 'vue3-recaptcha2' library may need to update its package.json or typings?

Hi, i have an problem with typescript in vue3 composition api for build.

There are types at '/home/serii/Sites/vue/vue-silcompa/node_modules/vue3-recaptcha2/dist_types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vue3-recaptcha2' library may need to update its package.json or typings.

I fixed directly in node_modules in vue3-recaptcha2/package.json, replaced this code:

  "exports": {
    ".": {
      "import": {
        "types": "./dist_types/index.d.ts",
        "node": "./index.mjs",
        "default": "./dist/vue3-recaptcha2.es.js"
      },
      "require": "./dist/vue3-recaptcha2.umd.js"
    }
  },

Can you update the package?

Double show

Good job !

However, there is a typo in the props.. You wrote two times "show" so the component is expected a number for the show props ๐Ÿ˜„

reCAPTCHA placeholder element must be an element or id

I just follow the example:

<template>
  <vue-recaptcha
          siteKey="..."
          :show="show"
          size="normal"
          theme="dark"
          @verify="recaptchaVerified"
          @expire="recaptchaExpired"
          @fail="recaptchaFailed"
          ref="recaptcha">
  </vue-recaptcha>
</template>

<script>
import { defineComponent, ref } from 'vue';
import vueRecaptcha from 'vue3-recaptcha2';

export default defineComponent({
  components: {
     vueRecaptcha
  },
  setup(){
    const recaptcha = ref('')

    return{
      recaptcha,

      show: ref(false),
      recaptchaVerified(response) {},
      recaptchaExpired() {
        recaptcha.value.reset();
      },
      recaptchaFailed() {}
    }
  }
})
</script>

Test mode

Hi,

Isn't there a way to activate a test mode, so we can use it in our development environment?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.