luoawai
2023-04-05 6b30c9f7bb97be4ad0af33b99072ec8bef26af90
fix(useFormItem):修复ApiSelect的onChange事件获取不到第二个参数(#2592) (#2674)

1个文件已修改
6 ■■■■■ 已修改文件
src/hooks/component/useFormItem.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/component/useFormItem.ts
@@ -1,5 +1,5 @@
import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue';
import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw } from 'vue';
import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw, nextTick } from 'vue';
import { isEqual } from 'lodash-es';
@@ -41,7 +41,9 @@
      if (isEqual(value, defaultState.value)) return;
      innerState.value = value as T[keyof T];
      emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || []));
      nextTick(()=>{
        emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || []));
      })
    },
  });