From 49451ae606009d1f5ab0b98f84535892d3fd7646 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Thu, 20 Jun 2024 15:24:16 +0800 Subject: [PATCH] fix: #458 --- src/components/Form/src/Form.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue index 468cf6e..eb18f75 100644 --- a/src/components/Form/src/Form.vue +++ b/src/components/Form/src/Form.vue @@ -249,8 +249,11 @@ export default defineComponent({ // 渲染formItem const renderFormItem = (item: FormSchema) => { - // 如果有optionApi,优先使用optionApi - if (item.optionApi) { + // 如果有optionApi,优先使用optionApi, 并且options不存在或者为空数组 + if ( + item.optionApi && + (!item.componentProps?.options || !item.componentProps?.options.length) + ) { // 内部自动调用接口,不影响其它渲染 getOptions(item.optionApi, item) }