Simple JSON editor component.
- Source:
Example
<JsonEditor />
Methods
(computed) style()
Sets style of the component
(function) data()
Method data
- Source:
(method) alignWithPreviousIndentation(event) → {void}
Aligns the current line's indentation with the previous line's indentation when the tab key is pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The keyboard event triggered by pressing the tab key. |
Returns:
- Type
- void
(method) focus()
Focuses the JSON editor.
(method) handleComponentBlur(event)
Handles the blur event of the component.
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The blur event. |
(method) inputHandler()
Method inputHandler
(method) insertSuggestion()
Method insertSuggestion
(method) onKeyDown(jsonString)
Displays JSON in a formatted way.
Parameters:
Name | Type | Description |
---|---|---|
jsonString |
string | The JSON string to format. |
(method) parse()
Parses the JSON string.
(method) stringify()
Stringifies the JSON string.
(method) updateIcon(value)
Updates the icon.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The value to update. |
(method) updateJson(event)
Updates the JSON string.
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The input event. |
(function) mounted()
Initializes the component.