File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ title: Submit Button
33description : Customizable submit button component for Nuxt Auto Form.
44---
55
6+ By default, Nuxt Auto Form provides a submit button at the bottom of the form.
7+ When form is not valid, the ` aria-disabled ` property is set to ` true ` on the button.
8+
69## Customization
710
811Most use cases only require changing the ** submit button** style or text.
@@ -77,7 +80,7 @@ defineProps<{
7780 <UButton
7881 type="submit"
7982 color="neutral"
80- :disabled
83+ :class=" disabled ? 'bg-red-500' : ''"
8184 class="w-full flex justify-center cursor-pointer"
8285 label="My custom send button"
8386 />
Original file line number Diff line number Diff line change @@ -100,8 +100,6 @@ You can access the following methods by using `ref` on the `<AutoForm/>` compone
100100``` vue
101101<script setup lang="ts">
102102const formRef = useTemplateRef('form')
103-
104- ...
105103</script>
106104
107105<template>
Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ const submitButton = computed(() => {
111111
112112const submitButtonProps = computed (() => {
113113 return {
114+ ariaDisabled: true ,
114115 ... submitButton .value ?.props ,
115- disabled: isButtonDisabled .value ,
116116 }
117117})
118118 </script >
You can’t perform that action at this time.
0 commit comments