Skip to content

JSON Schema Form API / @xunserver-jsf/core / FormInstance

Interface: FormInstance ​

Defined in: core/src/runtime/form/contracts.ts:150

事务化表单实例。公开 snapshot 只读;mutation 必须走下列 command。

Properties ​

model ​

readonly model: CompiledFormModel

Defined in: core/src/runtime/form/contracts.ts:151

Methods ​

applyErrors() ​

applyErrors(errors, options?): void

Defined in: core/src/runtime/form/contracts.ts:168

Parameters ​

errors ​

readonly ServerErrorInput[]

options? ​

ApplyErrorsOptions

Returns ​

void


array() ​

array(path): ArrayInstance

Defined in: core/src/runtime/form/contracts.ts:164

Parameters ​

path ​

InstancePathLike

Returns ​

ArrayInstance


blur() ​

blur(viewId): void

Defined in: core/src/runtime/form/contracts.ts:160

Parameters ​

viewId ​

ViewNodeId

Returns ​

void


focus() ​

focus(viewId): void

Defined in: core/src/runtime/form/contracts.ts:159

Parameters ​

viewId ​

ViewNodeId

Returns ​

void


getField() ​

getField(path): FieldInstance

Defined in: core/src/runtime/form/contracts.ts:155

Parameters ​

path ​

InstancePathLike

Returns ​

FieldInstance


getState() ​

getState(): FormSnapshot

Defined in: core/src/runtime/form/contracts.ts:154

Returns ​

FormSnapshot


getValue() ​

getValue(path): JsonValue | undefined

Defined in: core/src/runtime/form/contracts.ts:152

Parameters ​

path ​

InstancePathLike

Returns ​

JsonValue | undefined


getValues() ​

getValues(): JsonValue

Defined in: core/src/runtime/form/contracts.ts:153

Returns ​

JsonValue


reset() ​

reset(): void

Defined in: core/src/runtime/form/contracts.ts:163

Returns ​

void


scope() ​

scope(path): ScopedFormInstance

Defined in: core/src/runtime/form/contracts.ts:165

Parameters ​

path ​

InstancePathLike

Returns ​

ScopedFormInstance


serialize() ​

serialize(options?): JsonValue

Defined in: core/src/runtime/form/contracts.ts:166

Parameters ​

options? ​

SerializeOptions

Returns ​

JsonValue


setActiveTab() ​

setActiveTab(viewId, tabKey): void

Defined in: core/src/runtime/form/contracts.ts:162

Parameters ​

viewId ​

ViewNodeId

tabKey ​

string | null

Returns ​

void


setCollapsed() ​

setCollapsed(viewId, collapsed): void

Defined in: core/src/runtime/form/contracts.ts:161

Parameters ​

viewId ​

ViewNodeId

collapsed ​

boolean

Returns ​

void


setValue() ​

setValue(path, value): void

Defined in: core/src/runtime/form/contracts.ts:156

Parameters ​

path ​

InstancePathLike

value ​

unknown

Returns ​

void


setValues() ​

setValues(values): void

Defined in: core/src/runtime/form/contracts.ts:157

Parameters ​

values ​

unknown

Returns ​

void


submit() ​

submit(handler): Promise<SubmitResult>

Defined in: core/src/runtime/form/contracts.ts:169

Parameters ​

handler ​

SubmitHandler

Returns ​

Promise<SubmitResult>


touch() ​

touch(path): void

Defined in: core/src/runtime/form/contracts.ts:158

Parameters ​

path ​

InstancePathLike

Returns ​

void


validate() ​

validate(): Promise<ValidationResult>

Defined in: core/src/runtime/form/contracts.ts:167

Returns ​

Promise<ValidationResult>