Skip to content
This repository was archived by the owner on Sep 24, 2024. It is now read-only.

Commit 52f0f18

Browse files
SelemondevSelemondev
authored andcommitted
fix(app): remove redundant code
This pull request is intended to remove redundant code from the FormGroup component
1 parent 0beeba2 commit 52f0f18

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/nuxtlabs-ui-vue/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const email = ref('')
66

77
<template>
88
<div class="grid place-items-center w-full min-h-screen">
9-
<UFormGroup label="Email" error>
10-
<UInput placeholder="you@example.com" />
9+
<UFormGroup v-slot="{ error }" label="Email" :error="!email && 'You must enter an email'" help="This is a nice email!">
10+
<UInput v-model="email" type="email" placeholder="Enter email" :trailing-icon="error && 'heroicons:exclamation-triangle-20-solid'" />
1111
</UFormGroup>
1212
</div>
1313
</template>

packages/nuxtlabs-ui-vue/src/components/forms/FormGroup/UFormGroup.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export default defineComponent({
6666
6767
const wrapperClass = computed(() => twMerge(variant.value.root, attrs.class as string))
6868
69-
provide('form-path', props.name)
7069
const formErrors = inject<Ref<FormError[]> | null>('form-errors', null)
7170
const error = computed(() => {
7271
return (props.error && typeof props.error === 'string') || typeof props.error === 'boolean'

0 commit comments

Comments
 (0)