wip: form改造中
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user