当前 RunJS 执行上下文关联的数据表字段(CollectionField)实例,用于访问字段的元数据、类型、校验规则及关联信息。仅在字段绑定到数据表定义时存在;自定义/虚拟字段可能为 null。
null
interface
enum
targetCollection
collectionField.interface
注意:ctx.collectionField 仅在字段绑定到数据表(Collection)定义时可用;JSBlock 独立区块、无字段绑定的操作事件等场景中通常为 undefined,使用前建议做空值判断。
ctx.collectionField
undefined
collectionField: CollectionField | null | undefined;
name
string
status
userId
title
type
integer
belongsTo
input
select
m2o
o2m
m2m
collection
Collection
target
array
defaultValue
any
collectionName
foreignKey
sourceKey
targetKey
fullpath
main.users.status
resourceName
users.status
readonly
boolean
titleable
validation
object
uiSchema
targetCollectionTitleField
CollectionField
isAssociationField(): boolean
isRelationshipField(): boolean
getComponentProps(): object
getFields(): CollectionField[]
getFilterOperators(): object[]
$eq
$ne