Skip to content

Commit

Permalink
fix form
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie committed Jan 7, 2024
1 parent e57717d commit 948e534
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions components/base/FormCustom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Form } from '~/types';
import * as UForm from '#ui/components/forms/Form.vue';
import Form from '#ui/components/forms/Form.vue';
import FormGroup from '#ui/components/forms/FormGroup.vue';
import Input from '#ui/components/forms/Input.vue';
import Textarea from '#ui/components/forms/Textarea.vue';
Expand Down Expand Up @@ -38,8 +37,8 @@ function renderInput(item: { [key: string]: any }, name: string, state: any) {
export default defineComponent({
props: {
schema: {
type: Array as PropType<Form['schema']>,
required: true,
type: Array,
default: () => [],
},
state: {
type: Object,
Expand All @@ -53,7 +52,7 @@ export default defineComponent({
},
},
setup(props) {
const groups = props.schema?.map((item) => {
const groups = props.schema.map((item) => {
const { name, label, placeholder, width, description } = item as { [key: string]: any };

Check warning on line 56 in components/base/FormCustom.ts

View workflow job for this annotation

GitHub Actions / Lint

'placeholder' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 56 in components/base/FormCustom.ts

View workflow job for this annotation

GitHub Actions / Lint

'width' is assigned a value but never used. Allowed unused vars must match /^_/u

// @ts-ignore
Expand All @@ -65,10 +64,6 @@ export default defineComponent({
]);
});

if (!groups) {
return () => null;
}

// Add the submit button to the groups array
groups.push(
h(
Expand All @@ -88,6 +83,6 @@ export default defineComponent({
);

// @ts-ignore
return () => h(UForm, { state: props.state, validate: props.validate }, () => groups);
return () => h(Form, { state: props.state, validate: props.validate }, () => groups);
},
});

0 comments on commit 948e534

Please sign in to comment.