baseForm.vue
706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<template>
<BasicForm @register="register" />
</template>
<script lang="ts" setup>
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
const schemas: FormSchema[] = [
{
field: 'field1',
component: 'Input',
label: '字段1',
span: 8,
// colProps: {
// span: 8,
// },
componentProps: {
placeholder: '自定义placeholder',
onChange: (_e: any) => {
//
},
},
},
{
field: 'field2',
component: 'Input',
label: '字段2',
span: 8,
// colProps: {
// span: 8,
// },
},
];
const [register] = useForm({
schemas,
});
</script>