kailong321200875 10 ヶ月 前
コミット
49451ae606
1 ファイル変更5 行追加2 行削除
  1. 5 2
      src/components/Form/src/Form.vue

+ 5 - 2
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)
       }