blockly > Workspace > getVariableById

เมธอด Workspace.getVariableById()

v12: ใช้ Blockly.Workspace.getVariableMap().getVariableById

ค้นหาตัวแปรตามรหัสที่ระบุและแสดงผล แสดงผล Null หากไม่พบ

ลายเซ็น:

getVariableById(id: string): IVariableModel<IVariableState> | null;

พารามิเตอร์

พารามิเตอร์ ประเภท คำอธิบาย
id สตริง รหัสที่จะตรวจสอบ

การคืนสินค้า:

IVariableModel<IVariableState> | null

ตัวแปรที่มีรหัสที่ระบุ