blockly > 连接 > getShadowState

Connection.getShadowState() 方法

返回连接的影子块的序列化对象表示形式。

Signature:

getShadowState(returnCurrent?: boolean): blocks.State | null;

参数

参数 类型 说明
returnCurrent boolean (可选)如果为 true,并且影子块当前已附加到此连接,则会序列化该块的状态并返回该状态(以确保字段值正确无误)。否则,将仅返回已保存的状态。

返回

blocks.State | null

块的序列化对象表示形式,或 null。