Перейти к основному содержимому

syncFields()

function syncFields<TForm, T>(
field1,
field2,
options?): void;

Defined in: core/behavior/behaviors/sync-fields.ts:32

Двусторонняя синхронизация двух полей

Type Parameters

TForm

TForm extends FormFields

T

T extends FormValue

Parameters

field1

FieldPathNode<TForm, T>

Первое поле

field2

FieldPathNode<TForm, T>

Второе поле

options?

SyncFieldsOptions<T>

Опции

Returns

void

Example

const schema: BehaviorSchemaFn<MyForm> = (path) => {
// Синхронизировать два поля
syncFields(path.email, path.emailCopy);
};