Browse Source

fix: resolve onChange issue in form component (#4890)

Vben 4 months ago
parent
commit
86e52ce58a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      packages/@core/ui-kit/form-ui/src/form-render/form-field.vue

+ 6 - 0
packages/@core/ui-kit/form-ui/src/form-render/form-field.vue

@@ -238,6 +238,12 @@ function createComponentProps(slotProps: Record<string, any>) {
     ...slotProps.componentField,
     ...computedProps.value,
     ...bindEvents,
+    ...(Reflect.has(computedProps.value, 'onChange')
+      ? { onChange: computedProps.value.onChange }
+      : {}),
+    ...(Reflect.has(computedProps.value, 'onInput')
+      ? { onInput: computedProps.value.onInput }
+      : {}),
   };
 
   return binds;