0

在我的 Blockly 项目中,我有两个 3 blocksrcm_a和.rcm_brcm_c

Blockly.defineBlocksWithJsonArray([{
  "type": "rcm_c",
  "message0": "Requirement block- rcm_a: %1 rcm_b: %2",
  "args0": [
    {
      "type": "input_value",
      "name": "rcm_a"
    },
    {
      "type": "input_value",
      "name": "rcm_b",
      "check": ["rcm_b"]
    }
  ],
  "output": "Text",
  "colour": "%{BKY_LOOPS_HUE}"
}]);

如您所见rcm_c,我试图将第二个输入限制为 block rcm_b,这显然不起作用。相同的输入将不接受任何输入类型。这是rcm_b的代码:

Blockly.defineBlocksWithJsonArray([{
  "type": "rcm_b",
  "message0": "rcm_b %1",
  "args0": [
    {
      "type": "input_value",
      "name": "VALUE1",
      "check": "String"
    }
  ],
  "output": "Text",
  "colour": "%{BKY_LOOPS_HUE}"
}]);

我尝试按照本指南的 Statement Stacks 部分(我知道我正在尝试输入检查输入而不是语句)来实现类型检查。我究竟做错了什么?

非常感谢您的帮助!

4

1 回答 1

0

啊,似乎rcm_b需要的“输出” rcm_b

于 2020-02-07T03:41:09.067 回答