vue-recaptcha-v3 icon indicating copy to clipboard operation
vue-recaptcha-v3 copied to clipboard

hideBadge and showBadge methods do not exist

Open Anaphase opened this issue 3 years ago • 2 comments

The README indicates that there should be methods called hideBadge and showBadge:

Screen Shot 2022-01-10 at 4 18 11 PM

But when I try to do this.$recaptchaInstance.showBadge() inside my component, I can an error that says the methods do not exist. I can't see them defined anywhere in this repo; maybe it's a remnant of old code?

Anaphase avatar Jan 10 '22 22:01 Anaphase

Thanks for reporting this issue!

To access the actual reCAPTCHA instance, you need to use it like this: this.$recaptchaInstance.value.hideBadge() That's because it's a Ref.

I'll update the README asap.

WipeAir avatar Jan 11 '22 09:01 WipeAir

edit: i found way to showBadge() n hideBadge() inside setup() method, but make sure reCaptcha has been loaded.

setup(){
  const { instance} = useReCaptcha();
  instance.value.showBadge();
  instance.value.hideBadge();
}

original answer :

Thanks for reporting this issue!

To access the actual reCAPTCHA instance, you need to use it like this: this.$recaptchaInstance.value.hideBadge() That's because it's a Ref.

I'll update the README asap.

how to access that inside setup() method ?

rwaddin avatar Oct 14 '22 09:10 rwaddin