Aby utworzyć niestandardowe dane wejściowe, musisz podklasyfikować Input lub jedno z
jej podklas.
classMyInputextendsBlockly.inputs.Input{// The constructor should always take in a name and a block to be compatible// with JSON block definitions.constructor(name,block){super(name,block);// etc...}}
Opcjonalnie utwórz połączenie
Jeśli chcesz, aby dane wejściowe miały połączenie, musisz je utworzyć w
przez wywołanie metody makeConnection.
[null,null,["Ostatnia aktualizacja: 2024-09-09 UTC."],[[["Subclass `Blockly.inputs.Input` to create a custom input, ensuring the constructor accepts a name and block for JSON compatibility."],["Optionally create a connection for the input using the `makeConnection` method within the constructor."],["Register the custom input with `Blockly.registry` to enable its usage in JSON block definitions, associating it with a unique string identifier."],["Custom inputs cannot replace built-in inputs, nor can custom JSON configuration be added to built-in inputs."]]],["To create a custom input, subclass the `Input` class, including a constructor that accepts a name and block. Optionally, create a connection within the constructor using the `makeConnection` method. To use the custom input in JSON block definitions, register it with `Blockly.registry.register`, associating it with a unique string. Note that unlike custom fields, built-in inputs cannot be overridden and do not accept custom JSON configurations.\n"]]