【问题标题】:How to add the "Functions tab" to Google's blockly如何将“功能标签”添加到 Google 的 blockly
【发布时间】:2015-03-23 14:25:27
【问题描述】:

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

我如何添加函数和变量选项卡,因为提供的文档看起来很浅。文档:https://developers.google.com/blockly/installation/code-generators

提前致谢!

【问题讨论】:

    标签: javascript code-generation blockly


    【解决方案1】:

    块状演示左侧的“菜单项”或“选项卡”组成了“工具箱” 要在工具箱上添加更多项目,请检查https://developers.google.com/blockly/installation/toolbox

    例如,在将函数和变量添加到工具箱的情况下,将下面的 xml 代码添加到您的 index.html 中。

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

    稍微检查一下 index.html 就会告诉您 xml 代码是在哪里编译的,并且您会正确地插入代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 2019-05-07
      • 2010-11-19
      相关资源
      最近更新 更多