Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
blockly > Eingaben > Eingabe
Klasse für eine Eingabe mit optionalen Feldern.
Unterschrift:
export declare class Input
Konstruktoren
Attribute
Methoden
Methode |
Modifikatoren |
Beschreibung |
appendField(field, opt_name) |
|
Fügen Sie am Ende der Eingabefeldzeile ein Feld (oder ein Label aus einem String) sowie alle Präfix- und Suffixfelder hinzu. |
dispose() |
|
Alle Links zu dieser Eingabe trennen. |
getShadowDom() |
|
Gibt die XML-Darstellung des Schattenblocks der Verbindung zurück. |
getSourceBlock() |
|
Ruft den Quellblock für diese Eingabe ab. |
init() |
|
Initialisieren Sie die Felder für diese Eingabe. |
insertFieldAt(index, Field, opt_name) |
|
Fügt ein Feld (oder ein Label aus einem String) sowie alle Präfix- und Suffixfelder an der Position der Zeile des Eingabefelds ein. |
isVisible() |
|
Ruft ab, ob diese Eingabe sichtbar ist oder nicht. |
makeConnection(type) |
protected |
Erstellt eine Verbindung anhand des Typs des Quellblocks dieser Eingabe. Korrekte Erstellung von monitorlosen Verbindungen für monitorlose Blöcke und gerenderte Verbindungen für gerenderte Blöcke |
removeField(name, opt_quiet) |
|
Entfernt ein Feld aus dieser Eingabe. |
setAlign(align) |
|
Ändern Sie die Ausrichtung der Felder der Verbindung. |
setCheck(check) |
|
Ändern Sie die Kompatibilität einer Verbindung. |
setShadowDom(shadow) |
|
Ändert den Schattenblock der Verbindung. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003einputs.Input\u003c/code\u003e class in Blockly manages inputs with optional fields for blocks, handling their properties and connections.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to add, remove, and modify fields within the input, as well as control its alignment and visibility.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this class to customize block inputs by specifying field types, connections, and other attributes.\u003c/p\u003e\n"],["\u003cp\u003eThe class also offers methods to manage connections to other blocks, including setting compatibility and shadow blocks.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [inputs](./blockly.inputs_namespace.md) \\\u003e [Input](./blockly.inputs_namespace.input_class.md)\n\ninputs.Input class\n------------------\n\nClass for an input with optional fields.\n\n**Signature:** \n\n export declare class Input \n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|-----------------------------------------------------------------------------------------------------------|-----------|------------------------------------------------|\n| [(constructor)(name, sourceBlock)](./blockly.inputs_namespace.input_class._constructor__1_constructor.md) | | Constructs a new instance of the `Input` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-----------------------------------------------------------------------------|------------|-------------------------------------------------------------|------------------------------------------------------|\n| [align](./blockly.inputs_namespace.input_class.align_property.md) | | [Align](./blockly.inputs_namespace.align_enum.md) | Alignment of input's fields (left, right or centre). |\n| [connection](./blockly.inputs_namespace.input_class.connection_property.md) | | [Connection](./blockly.connection_class.md) \\| null | |\n| [fieldRow](./blockly.inputs_namespace.input_class.fieldrow_property.md) | | [Field](./blockly.field_class.md)\\[\\] | |\n| [name](./blockly.inputs_namespace.input_class.name_property.md) | | string | |\n| [type](./blockly.inputs_namespace.input_class.type_property.md) | `readonly` | [inputTypes](./blockly.inputs_namespace.inputtypes_enum.md) | |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|-----------------------------------------------------------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [appendField(field, opt_name)](./blockly.inputs_namespace.input_class.appendfield_1_method.md) | | Add a field (or label from string), and all prefix and suffix fields, to the end of the input's field row. |\n| [dispose()](./blockly.inputs_namespace.input_class.dispose_1_method.md) | | Sever all links to this input. |\n| [getShadowDom()](./blockly.inputs_namespace.input_class.getshadowdom_1_method.md) | | Returns the XML representation of the connection's shadow block. |\n| [getSourceBlock()](./blockly.inputs_namespace.input_class.getsourceblock_1_method.md) | | Get the source block for this input. |\n| [init()](./blockly.inputs_namespace.input_class.init_1_method.md) | | Initialize the fields on this input. |\n| [insertFieldAt(index, field, opt_name)](./blockly.inputs_namespace.input_class.insertfieldat_1_method.md) | | Inserts a field (or label from string), and all prefix and suffix fields, at the location of the input's field row. |\n| [isVisible()](./blockly.inputs_namespace.input_class.isvisible_1_method.md) | | Gets whether this input is visible or not. |\n| [makeConnection(type)](./blockly.inputs_namespace.input_class.makeconnection_1_method.md) | `protected` | Constructs a connection based on the type of this input's source block. Properly handles constructing headless connections for headless blocks and rendered connections for rendered blocks. |\n| [removeField(name, opt_quiet)](./blockly.inputs_namespace.input_class.removefield_1_method.md) | | Remove a field from this input. |\n| [setAlign(align)](./blockly.inputs_namespace.input_class.setalign_1_method.md) | | Change the alignment of the connection's field(s). |\n| [setCheck(check)](./blockly.inputs_namespace.input_class.setcheck_1_method.md) | | Change a connection's compatibility. |\n| [setShadowDom(shadow)](./blockly.inputs_namespace.input_class.setshadowdom_1_method.md) | | Changes the connection's shadow block. |"]]