根据blockly自带的Demo,我们在生成代码的时候只有逻辑、循环、数学和文本选项。这里:https ://blockly-demo.appspot.com/static/demos/generator/index.html
由于文档提供的内容似乎很浅,如何添加函数和变量选项卡。文档:https ://developers.google.com/blockly/installation/code-generators
提前致谢!
根据blockly自带的Demo,我们在生成代码的时候只有逻辑、循环、数学和文本选项。这里:https ://blockly-demo.appspot.com/static/demos/generator/index.html
由于文档提供的内容似乎很浅,如何添加函数和变量选项卡。文档:https ://developers.google.com/blockly/installation/code-generators
提前致谢!
The "menu items" or "tabs" on the left of blockly demos make up the "Toolbox" In order to add more items on the tool box, check https://developers.google.com/blockly/installation/toolbox
For example, in the case of adding the Functions and Variables to the Toolbox, add the xml code below to your index.html.
<category name="Variables" custom="VARIABLE"></category>
<category name="Functions" custom="PROCEDURE"></category>
A little inspection of index.html will tell you where the xml code is compiled and you'll insert your code appropriately.