如何将“功能选项卡”添加到谷歌的块

How to add the "Functions tab" to Google's blockly

本文关键字:添加 谷歌 功能选项卡 功能 选项      更新时间:2023-09-26

根据块自带的演示,我们在生成代码时只有逻辑、循环、数学和文本选项。 这里: https://blockly-demo.appspot.com/static/demos/generator/index.html

如何添加函数和变量选项卡,因为文档提供的内容似乎很肤浅。文档:https://developers.google.com/blockly/installation/code-generators

提前感谢!

状演示左侧的"菜单项"或"选项卡"构成了"工具箱"要在工具箱中添加更多项目,请选中 https://developers.google.com/blockly/installation/toolbox

例如,在

将函数和变量添加到工具箱的情况下,请将下面的 xml 代码添加到索引.html。

<category name="Variables" custom="VARIABLE"></category>
<category name="Functions" custom="PROCEDURE"></category>

稍微检查一下 index.html 会告诉你 xml 代码的编译位置,你会适当地插入代码。