Skip to content

API ​

Props ​

NameTypeDefaultDescription
modelValuestring''Editor content.
triggerCharactersstring[][]Extra completion trigger characters.
customKeywordsstring[][]Extra SQL completion keywords.
databaseOptionsDatabaseOption[][]Database, table and field completion data.
widthnumber | string0Editor width. Numbers are pixels; percentages use parent width. Uses parent width when set to 0.
heightnumber | string100Editor height. Numbers are pixels; percentages use parent height.
monacoEditorOptionIStandaloneEditorConstructionOptions{}Native Monaco editor options.
monacoEditorTheme'vs' | 'vs-dark' | 'hc-black''vs'Monaco theme.

Events ​

NamePayloadDescription
update:modelValuestringEmitted when editor content changes.
editor-readymonaco.editor.IStandaloneCodeEditorEmitted once the Monaco instance is created.
focus—Editor gains focus.
blur—Editor loses focus.
cursor-changemonaco.editor.ICursorPositionChangedEventCursor position changes.
selection-changemonaco.editor.ICursorSelectionChangedEventSelection changes.

Exposed Methods ​

NameDescription
initEditorInitialize the editor instance.
resetEditorClear the editor content.
insertTextInsert text at the cursor.
getSelectedTextGet the current selected text.
replaceSelectedTextReplace the current selection.
replaceTextReplace the full editor content.
getEditorGet the raw IStandaloneCodeEditor instance, null if absent.

Released under the MIT License.