N
Nuxt5mo ago
Jon 久世

How Do I Access AuthForm Internal State?

I need to access the AuthForm internal state so I can pass an email address for a Forget Password feature. Documentation is not clear on how to do this. How do we access the state?
5 Replies
Smef
Smef5mo ago
I think this is a NuxtUI question specifically, right? It's not something I've used, but I wanted to clarify
Jon 久世
Jon 久世OP5mo ago
Correct, it's a Nuxt UI Pro specific issue. As the AuthForm is a component only available under that tier.
Jon 久世
Jon 久世OP5mo ago
GitHub
How Do I Access AuthForm Internal State? · Issue #1916 · nuxt/ui
Description I need to access the AuthForm internal state so I can pass an email address for a Forget Password feature. Documentation is not clear on how to do this. How do we access the state?
Niklas
Niklas5mo ago
You should be able to access the internal state via an ref Found in the ui-pro repo: https://github.com/nuxt/ui-pro/blob/16019a71156144d1351aad52ee3fdca41a21bc2a/components/auth/AuthForm.vue#L202
<UAuthForm
ref="authForm"
...
/>

<script setup lang="ts">
const authForm = ref();

forgetPassword() {
authForm.value.state. //...
}
</script>
<UAuthForm
ref="authForm"
...
/>

<script setup lang="ts">
const authForm = ref();

forgetPassword() {
authForm.value.state. //...
}
</script>
Jon 久世
Jon 久世OP5mo ago
Thanks soo much!!! I'm on mobile now but i'll check it out soon and report back how it goes. So authForm.value.state doesn't work but if you pass authForm.state it does work!! Thanks again 😃 🙏
Want results from more Discord servers?
Add your server