wip: form改造中

This commit is contained in:
kailong321200875
2023-04-18 20:03:01 +08:00
parent cc18f297ef
commit 09fe3467f6
5 changed files with 1535 additions and 338 deletions

View File

@@ -30,14 +30,7 @@ export const useForm = (props?: FormProps) => {
}
// 一些内置的方法
const methods: {
setProps: (props: Recordable) => void
setValues: (data: Recordable) => void
getFormData: <T = Recordable | undefined>() => Promise<T>
setSchema: (schemaProps: FormSetPropsType[]) => void
addSchema: (formSchema: FormSchema, index?: number) => void
delSchema: (field: string) => void
} = {
const methods = {
setProps: async (props: FormProps = {}) => {
const form = await getForm()
form?.setProps(props)
@@ -89,7 +82,7 @@ export const useForm = (props?: FormProps) => {
return {
register,
elFormRef,
formRef: elFormRef,
methods
}
}