Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import { Checkbox } from 'vue-recaptcha' throw error: useRecaptcha() is called without provider. #1870

Open
SnowdropK opened this issue Sep 14, 2024 · 0 comments
Labels

Comments

@SnowdropK
Copy link

SnowdropK commented Sep 14, 2024

Description

In a vue3 project, I use Checkbox by import { Checkbox } from 'vue-recaptcha', recaptcha type is v2.

So how to get token, not specified in the document

Minimal Reproducible Example

main.ts

import { VueRecaptchaPlugin } from 'vue-recaptcha'

app.use(router).use(pinia).use(head).use(VueRecaptchaPlugin, { v2SiteKey: my captcha key }).mount('#app')

APP.vue

import { useRecaptchaProvider } from 'vue-recaptcha'

onMounted(() => {
  useRecaptchaProvider()
})

view.vue

import { Checkbox } from 'vue-recaptcha'

<Checkbox v-model="response" />

System info

vue version: ^3.4.21
"vue-recaptcha": "3.0.0-alpha.6",

@SnowdropK SnowdropK added the bug label Sep 14, 2024
@SnowdropK SnowdropK changed the title import { Checkbox } from 'vue-recaptcha' but throw error: useRecaptcha() is called without provider. import { Checkbox } from 'vue-recaptcha' throw error: useRecaptcha() is called without provider. Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant