From 7db92b069e1fce711403eeea2239f17af6ffa5ee Mon Sep 17 00:00:00 2001 From: chenminjie <943130926@qq.com> Date: Wed, 27 Nov 2024 17:05:31 +0800 Subject: [PATCH] fix: ensure computedEvents returns an empty object when componentEvents is undefined --- .../@core/ui-kit/form-ui/src/form-render/form-field.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue index fdc16fe5..24e2770b 100644 --- a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue +++ b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue @@ -161,9 +161,11 @@ const computedProps = computed(() => { }); const computedEvents = computed(() => { - return isFunction(componentEvents) - ? componentEvents(values.value, formApi!) - : componentEvents; + return ( + (isFunction(componentEvents) + ? componentEvents(values.value, formApi!) + : componentEvents) ?? {} + ); }); watch(