blockly > utils > 解析 > replaceMessageReferences

utils.parsing.replaceMessageReferences() 函数

如果消息是字符串,则替换消息中的字符串表引用。例如,“%{bky_my_msg}”和“%{BKY_MY_MSG}”都会被替换为 Msg['MY_MSG'] 中的值。

Signature:

export declare function replaceMessageReferences(message: string | any): string;

参数

参数 类型 说明
信息 字符串 | 任意 消息,可能是包含字符串表引用的字符串。

返回

string

已替换消息引用的字符串。