blockly > 工作区 > renameVariableById

Workspace.renameVariableById() 方法

通过在变量映射中更新变量名称来重命名变量。确定要使用指定 ID 重命名的变量。

Signature:

renameVariableById(id: string, newName: string): void;

参数

参数 类型 说明
id string 要重命名的变量的 ID。
newName string 新变量名称。

返回

void