perf: 优化表单组件

This commit is contained in:
kailong321200875
2023-06-21 14:16:48 +08:00
parent 3e4e27c21f
commit 77a3866248
4 changed files with 27 additions and 7 deletions

View File

@@ -40,7 +40,6 @@ export interface FormExpose {
addSchema: (formSchema: FormSchema, index?: number) => void
setSchema: (schemaProps: FormSetProps[]) => void
formModel: Recordable
getElFormRef: () => ComponentRef<typeof ElForm>
getComponentExpose: (field: string) => any
getFormItemExpose: (field: string) => any
}

View File

@@ -125,10 +125,6 @@ export default defineComponent({
}
}
const getElFormRef = (): ComponentRef<typeof ElForm> => {
return unref(elFormRef) as ComponentRef<typeof ElForm>
}
const getOptions = async (fn: Function, field: string) => {
const options = await fn()
setSchema([
@@ -171,7 +167,6 @@ export default defineComponent({
delSchema,
addSchema,
setSchema,
getElFormRef,
getComponentExpose,
getFormItemExpose
})