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

I'm not sure how to use this #358

Open
kickthemooon opened this issue Dec 24, 2024 · 2 comments
Open

I'm not sure how to use this #358

kickthemooon opened this issue Dec 24, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@kickthemooon
Copy link

📚 Is your documentation request related to a problem?

I don't know how to use this.

🔍 Where should you find it?

I feel I you need a minimal working example usage right in the beginning.

ℹ️ Additional context

I have one request and a couple of questions.

First the request. Can you write a minimal working example usage of this in a nuxt form/component?

Assuming I have the flag addValidateEndpoint turned on, my questions are:

  1. In the usage you show the following:
<NuxtTurnstile v-model="token" />

My question is, do I need to generate this token or can I just remove this v-model? If I need to generate tokens, can you show an example of how?

  1. You also show this:
<template>
  <NuxtTurnstile ref="turnstile" />
  <button @click="turnstile.reset()">Reset token in template</button>
  <button @click="reset()">Reset token from handler</button>
</template>

<script setup>
  // you can call this template ref anything
  const turnstile = ref()

  function reset() {
    turnstile.value?.reset()
  }
</script>

I don't understand much here. Do I need to do this?

  1. What is the minimal code I need to write to get turnstile to work with addValidateEndpoint turned on?

Thanks.

@kickthemooon kickthemooon added the documentation Improvements or additions to documentation label Dec 24, 2024
@maige-app maige-app bot added the question Further information is requested label Dec 24, 2024
@danielroe
Copy link
Collaborator

You can see an example here: https://github.com/nuxt-modules/turnstile/blob/main/playground/pages/index.vue

@kickthemooon
Copy link
Author

I always look for the "example" directory. Will have to start looking for playground as well for nuxt projects at least. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants