Nuxt UI loading-auto prop to show the loading icon automatically while the @click promise is pending
Hi
taken from the (Nuxt UI docs)[https://ui3.nuxt.dev/components/button#loading] I should be able to add the prop
loading-auto to the UButton to disable.
I am using the button in a UForm and loading-auto is not working as expected because i guess the UButton is a type="submit" and not @click
how can I achieve this?Nuxt UI
Button Vue Component - Nuxt UI v3
A button element that can act as a link or trigger an action.
3 Replies
Hi @keyboarddabbler. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, I don't have enough specific information to fully answer your question about using the
loading-auto prop with a UButton inside a UForm. The documentation you referenced is not included in the provided sources, and there's no mention of a loading-auto prop for the UButton component in the available information.
However, I can provide some general information about loading states in Nuxt UI components based on the available sources:
1. The UButton component does support a loading prop to show a loading icon and disable the button. This is mentioned in the Button documentation:
2. For forms, you might be able to use the validate prop of the UForm component to handle the loading state. However, without more specific documentation about the UForm component, I can't provide a definitive solution.
3. If you need to manage the loading state manually, you could consider using a ref to control the loading state:
Unfortunately, the knowledge sources don't contain enough information about the specific loading-auto prop you mentioned or its behavior within a UForm. For the most accurate and up-to-date information, I recommend checking the latest Nuxt UI documentation or reaching out to the Nuxt UI community for support with this specific use case.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@412814388987428866> Kapa.ai is still learning and improving, please let me know how I did by reacting below.