fix: typo & defaultValues func context missing

This commit is contained in:
YuanHeDx 2025-03-11 15:05:31 +08:00
parent d3f093c6d9
commit 6331f44570
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ export class FormModelV2 extends FormModel implements Disposable {
// 计算初始值: defaultValues 是默认表单值不需要被format, 而rawInitialValues 是用户创建form 时传入的初始值可能不同于表单数据格式需要被format // 计算初始值: defaultValues 是默认表单值不需要被format, 而rawInitialValues 是用户创建form 时传入的初始值可能不同于表单数据格式需要被format
const defaultValues = const defaultValues =
typeof formMeta.defaultValues === 'function' typeof formMeta.defaultValues === 'function'
? formMeta.defaultValues() ? formMeta.defaultValues(this.nodeContext)
: formMeta.defaultValues; : formMeta.defaultValues;
const initialValues = formMeta.formatOnInit const initialValues = formMeta.formatOnInit

View File

@ -95,7 +95,7 @@ export interface FormMeta<TValues = any> {
/** /**
* Form data's complete default value. it will not be sent to formatOnInit, but used directly as form's value when needed. * Form data's complete default value. it will not be sent to formatOnInit, but used directly as form's value when needed.
*/ */
defaultValues?: TValues | ((contest: NodeContext) => TValues); defaultValues?: TValues | ((context: NodeContext) => TValues);
/** /**
* This function is to format the value when initiate the form, the returned value will be used as the initial value of the form. * This function is to format the value when initiate the form, the returned value will be used as the initial value of the form.
* @param value value input to node as initialValue. * @param value value input to node as initialValue.