Skip to content

Documentation / @geoverse/editor-core / coerceValue

Function: coerceValue() ​

ts
function coerceValue(type, raw): unknown;

Defined in: packages/editor-core/src/schema/index.ts:98

类型强转:把表单原始输入(多为字符串)转成字段类型对应的 JS 值。 无法转换时返回原值(交 validateValue 报错),空值原样返回。

Parameters ​

type ​

FieldType

raw ​

unknown

Returns ​

unknown