fix: Failure to export
parent
56ad5f4743
commit
1814ed00ef
|
@ -46,11 +46,11 @@ const schemas: FormSchema[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const [registerForm, { validateFields }] = useForm()
|
const [registerForm, { validate }] = useForm()
|
||||||
const [registerModal, { closeModal }] = useModalInner()
|
const [registerModal, { closeModal }] = useModalInner()
|
||||||
|
|
||||||
async function handleOk() {
|
async function handleOk() {
|
||||||
const res = (await validateFields()) as ExportModalResult
|
const res = await validate<ExportModalResult>()
|
||||||
const { filename, bookType } = res
|
const { filename, bookType } = res
|
||||||
emit('success', {
|
emit('success', {
|
||||||
filename: `${filename.split('.').shift()}.${bookType}`,
|
filename: `${filename.split('.').shift()}.${bookType}`,
|
||||||
|
|
|
@ -101,7 +101,7 @@ export function useForm(props?: Props): UseFormReturnType {
|
||||||
return form.submit()
|
return form.submit()
|
||||||
},
|
},
|
||||||
|
|
||||||
validate: async (nameList?: NamePath[] | false): Promise<Recordable> => {
|
validate: async <T = any>(nameList?: NamePath[] | false): Promise<T> => {
|
||||||
const form = await getForm()
|
const form = await getForm()
|
||||||
return form.validate(nameList)
|
return form.validate(nameList)
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,7 @@ export interface FormActionType {
|
||||||
removeSchemaByField: (field: string | string[]) => Promise<void>
|
removeSchemaByField: (field: string | string[]) => Promise<void>
|
||||||
appendSchemaByField: (schema: FormSchema | FormSchema[], prefixField: string | undefined, first?: boolean | undefined) => Promise<void>
|
appendSchemaByField: (schema: FormSchema | FormSchema[], prefixField: string | undefined, first?: boolean | undefined) => Promise<void>
|
||||||
validateFields: (nameList?: NamePath[]) => Promise<any>
|
validateFields: (nameList?: NamePath[]) => Promise<any>
|
||||||
validate: (nameList?: NamePath[] | false) => Promise<any>
|
validate: <T = any>(nameList?: NamePath[] | false) => Promise<T>
|
||||||
scrollToField: (name: NamePath, options?: ScrollOptions) => Promise<void>
|
scrollToField: (name: NamePath, options?: ScrollOptions) => Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue