mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix: typo & defaultValues func context missing
This commit is contained in:
parent
d3f093c6d9
commit
6331f44570
@ -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
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user