#Props
Props are written in kebab-case in templates (tab-size) and camelCase in JavaScript (tabSize).
#Content
| Prop | Type | Default | Description |
|---|---|---|---|
model-value | string | Text | '' | The document. Use with v-model. (Not value.) |
placeholder | string | HTMLElement | undefined | Shown while the document is empty. See placeholder. |
tag | string | 'div' | Tag name of the root element. |
#Setup
| Prop | Type | Default | Description |
|---|---|---|---|
basic | boolean | false | Enables basicSetup. |
minimal | boolean | false | Enables minimalSetup. basic takes precedence. |
#Editing
| Prop | Type | Default | Description |
|---|---|---|---|
readonly | boolean | false | Prevents changes but keeps the editor focusable. See readOnly. |
disabled | boolean | false | Makes the editor non-editable and non-focusable. Inverse of editable. |
wrap | boolean | false | Enables line wrapping. |
tab | boolean | false | Indents with the Tab key (indentWithTab). |
tab-size | number | undefined | Tab size. |
indent-unit | string | undefined | Indentation unit. |
allow-multiple-selections | boolean | false | Allows multiple selections. |
line-separator | string | undefined | Line separator. \n when not set. |
keymap | KeyBinding[] | [] | Custom key bindings. |
#Language and linting
| Prop | Type | Default | Description |
|---|---|---|---|
lang | LanguageSupport | undefined | Language for syntax highlighting. See languages. |
linter | LintSource | undefined | Lint source, e.g. jsonParseLinter() or esLint(...). |
linter-config | object | {} | Linter config. |
force-linting | boolean | false | Runs the linter right away. See forceLinting. |
gutter | boolean | false | Shows the lint gutter. Requires linter. |
gutter-config | object | undefined | Lint gutter config. |
#Appearance
| Prop | Type | Default | Description |
|---|---|---|---|
dark | boolean | false | Marks the editor theme as dark. |
theme | Record<string, StyleSpec> | {} | Style spec passed to EditorView.theme. |
phrases | Record<string, string> | undefined | UI translations. |
#Scrolling
| Prop | Type | Default | Description |
|---|---|---|---|
scroll-into-view | boolean | true | Scrolls to the selection when modelValue is updated externally. See scrollIntoView. |
preserve-scroll-position | boolean | false | Keeps the scroll position when modelValue is updated externally. See scrollSnapshot. |
#Extensions
| Prop | Type | Default | Description |
|---|---|---|---|
extensions | Extension[] | [] | Additional extensions, appended after the ones generated from props. |