I use this package : https://www.npmjs.com/package/vue-recaptcha-v3
I add on my main.js :
import { VueReCaptcha } from 'vue-recaptcha-v3'
Vue.use(VueReCaptcha, { siteKey: 'xxxxxxx' })
I add this code :
await this.$recaptcha('login').then((token) => {
recaptcha = token
})
to my component to get token from google recapchta
My problem is the captcha icon in the lower right corner appears on all pages
I want it to only appear in certain components
Maybe I must to change this : Vue.use(VueReCaptcha, { siteKey: 'xxxxxxxxxxxxxxxxx' })
. Seems it still mounting to Vue.use
. I want to mount to a certain component instead of vue root instance
How can I solve this problem?
Update
I try like this :
Vue.use(VueReCaptcha, {
siteKey: 'xxxxxxx',
loaderOptions: {
useRecaptchaNet: true,
autoHideBadge: true
}
})
It hides the badge. I want the badge to still appear. But only on 1 page, the registration page. How can I do it?
autoHideBadge
withfalse
and add :.grecaptcha-badge { display:none !important; }
where you don't want to show it – GuertinautoHideBadge
withtrue
and add.grecaptcha-badge { display:block !important; }
. Right? – MerlenemerlinautoHideBadge
tofalse
and add css code (where you don't want to show it.) – GuertinautoHideBadge
with true and add.grecaptcha-badge { display:block !important; }
. It just change main.js and 1 component – Merlenemerlin