研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
分隔符
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在任意两个类别之间添加分隔符,都会在两个类别之间创建一条线和额外的空格。

您可以在 JSON 或 XML 工具箱定义中更改分隔符的类。
JSON
{
"kind": "sep",
"cssConfig": {
"container": "yourClassName"
}
}
XML
<sep css-container="yourClassName"></sep>
在任意两个代码块之间添加分隔符会在代码块之间创建一个间隔。默认情况下,每个分块与其下方的相邻分块之间相隔 24 像素。您可以使用“gap”属性更改此分隔,该属性将替换默认分隔。
这样,您就可以在工具箱中创建逻辑块组。

JSON
{
"kind": "flyoutToolbox",
"contents": [
{
"kind": "block",
"type":"math_number"
},
{
"kind": "sep",
"gap": "32"
},
{
"kind": "block",
"type"" "math_arithmetic"
"fields": {
"OP": "ADD"
},
},
{
"kind": "sep",
"gap": "8"
},
{
"kind": "block",
"type"" "math_arithmetic"
"fields": {
"OP": "MINUS"
},
}
]
}
XML
<xml id="toolbox" style="display: none">
<block type="math_number"></block>
<sep gap="32"></sep>
<block type="math_arithmetic">
<field name="OP">ADD</field>
</block>
<sep gap="8"></sep>
<block type="math_arithmetic">
<field name="OP">MINUS</field>
</block>
</xml>
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Separators\n\nAdding a separator between any two categories will create a line and extra space\nbetween the two categories.\n\nYou can change the class for the separator in your JSON or XML toolbox definition. \n\n### JSON\n\n {\n \"kind\": \"sep\",\n \"cssConfig\": {\n \"container\": \"yourClassName\"\n }\n }\n\n### XML\n\n \u003csep css-container=\"yourClassName\"\u003e\u003c/sep\u003e\n\nAdding a separator between any two blocks will create a gap between the blocks.\nBy default every block is separated from its lower neighbour by 24 pixels.\nThis separation may be changed using the 'gap' attribute, which will replace the\ndefault gap.\n\nThis allows you to create logical groups of blocks in the toolbox.\n\n### JSON\n\n {\n \"kind\": \"flyoutToolbox\",\n \"contents\": [\n {\n \"kind\": \"block\",\n \"type\":\"math_number\"\n },\n {\n \"kind\": \"sep\",\n \"gap\": \"32\"\n },\n {\n \"kind\": \"block\",\n \"type\"\" \"math_arithmetic\"\n \"fields\": {\n \"OP\": \"ADD\"\n },\n },\n {\n \"kind\": \"sep\",\n \"gap\": \"8\"\n },\n {\n \"kind\": \"block\",\n \"type\"\" \"math_arithmetic\"\n \"fields\": {\n \"OP\": \"MINUS\"\n },\n }\n ]\n }\n\n### XML\n\n \u003cxml id=\"toolbox\" style=\"display: none\"\u003e\n \u003cblock type=\"math_number\"\u003e\u003c/block\u003e\n \u003csep gap=\"32\"\u003e\u003c/sep\u003e\n \u003cblock type=\"math_arithmetic\"\u003e\n \u003cfield name=\"OP\"\u003eADD\u003c/field\u003e\n \u003c/block\u003e\n \u003csep gap=\"8\"\u003e\u003c/sep\u003e\n \u003cblock type=\"math_arithmetic\"\u003e\n \u003cfield name=\"OP\"\u003eMINUS\u003c/field\u003e\n \u003c/block\u003e\n \u003c/xml\u003e"]]