Skip to content

Commit 49451ae

Browse files
fix: #458
1 parent c77586c commit 49451ae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/Form/src/Form.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,11 @@ export default defineComponent({
249249
250250
// 渲染formItem
251251
const renderFormItem = (item: FormSchema) => {
252-
// 如果有optionApi,优先使用optionApi
253-
if (item.optionApi) {
252+
// 如果有optionApi,优先使用optionApi, 并且options不存在或者为空数组
253+
if (
254+
item.optionApi &&
255+
(!item.componentProps?.options || !item.componentProps?.options.length)
256+
) {
254257
// 内部自动调用接口,不影响其它渲染
255258
getOptions(item.optionApi, item)
256259
}

0 commit comments

Comments
 (0)