Open averri opened 3 years ago
you're right @averri, there is a implementation and/or documentation issue... but you can use it like this:
import { useReCaptcha } from 'vue-recaptcha-v3';
export default defineComponent({
name: 'BlaComponent',
setup() {
const reCaptcha = useReCaptcha();
async function recaptcha() {
await reCaptcha.recaptchaLoaded();
const token = await reCaptcha.executeRecaptcha('submit');
return await verifyRecaptcha(token);
}
return {
recaptcha,
}
Yeah but still remais undefined. Check #561
@vandelpavel you just need to verify it's there: ` import { useReCaptcha } from 'vue-recaptcha-v3';
export default defineComponent({ name: 'BlaComponent', setup() { const reCaptcha = useReCaptcha();
async function recaptcha() {
if (!reCaptcha) {
return alert('could not get recaptcha');
}
await reCaptcha.recaptchaLoaded();
const token = await reCaptcha.executeRecaptcha('submit');
return await verifyRecaptcha(token);
}
return {
recaptcha,
}
}); `
For anyone looking through this using Githubissues.
This library does not work as documented. I have followed all the instructions for configuring with Vue 3 composition API, this is what I get: