mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 10:33:50 +08:00
fix(useFormEvent): 修复表单项存在defaultValue时,updateSchema方法会将setFieldsValue设置的值覆盖问题 (#3287)
This commit is contained in:
parent
3b2760ca3a
commit
72ef3df57f
@ -2,7 +2,7 @@ import type { ComputedRef, Ref } from 'vue';
|
||||
import type { FormProps, FormSchemaInner as FormSchema, FormActionType } from '../types/form';
|
||||
import type { NamePath } from 'ant-design-vue/lib/form/interface';
|
||||
import { unref, toRaw, nextTick } from 'vue';
|
||||
import { isArray, isFunction, isObject, isString, isDef, isNil, isEmpty } from '/@/utils/is';
|
||||
import { isArray, isFunction, isObject, isString, isDef, isNil } from '/@/utils/is';
|
||||
import { deepMerge } from '/@/utils';
|
||||
import { dateItemType, handleInputNumberValue, defaultValueComponents } from '../helper';
|
||||
import { dateUtil } from '/@/utils/dateUtil';
|
||||
@ -310,9 +310,7 @@ export function useFormEvents({
|
||||
Reflect.has(item, 'field') &&
|
||||
item.field &&
|
||||
!isNil(item.defaultValue) &&
|
||||
(!(item.field in currentFieldsValue) ||
|
||||
isNil(currentFieldsValue[item.field]) ||
|
||||
isEmpty(currentFieldsValue[item.field]))
|
||||
(!(item.field in currentFieldsValue) || isNil(currentFieldsValue[item.field]))
|
||||
) {
|
||||
obj[item.field] = item.defaultValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user