@@ -111,13 +111,13 @@ import { EditorState } from '@codemirror/state'
111
111
setup() {
112
112
const code = ref(`console.log('Hello, world!')`)
113
113
const extensions = [javascript(), oneDark]
114
-
114
+
115
115
// Codemirror EditorView instance ref
116
116
const view = shallowRef()
117
117
const handleReady = (payload) => {
118
118
view.value = payload.view
119
119
}
120
-
120
+
121
121
// Status is available at all times via Codemirror EditorView
122
122
const getCodemirrorStates = () => {
123
123
const state = view.value.state
@@ -164,19 +164,20 @@ app.use(VueCodemirror, {
164
164
165
165
### Component Props
166
166
167
- | prop | description | type | default |
168
- | :------------ | :----------------------------------------------------------------------- | :----------------------- | :------ |
169
- | modelValue | The input values accepted by the component also support two-way binding. | ` String ` | ` '' ` |
170
- | autofocus | Focus editor immediately after mounted. | ` Boolean ` | ` false ` |
171
- | disabled | Disable input behavior and disable change state. | ` Boolean ` | ` false ` |
172
- | indentWithTab | Bind keyboard Tab key event. | ` Boolean ` | ` true ` |
173
- | tabSize | Specify the indent when the Tab key is pressed. | ` Number ` | ` 2 ` |
174
- | placeholder | Display when empty. | ` String ` | ` '' ` |
175
- | style | The CSS style object that acts on the CodeMirror itself. | ` Object ` | ` {} ` |
176
- | autoDestroy | Auto destroy the CodeMirror instance before the component unmount. | ` Boolean ` | ` true ` |
177
- | extensions | Passed to CodeMirror ` EditorState.create({ extensions }) ` | ` Extension ` | ` [] ` |
178
- | selection | Passed to CodeMirror ` EditorState.create({ selection }) ` | ` EditorSelection ` | - |
179
- | root | Passed to CodeMirror ` new EditorView({ root }) ` | ` ShadowRoot \| Document ` | - |
167
+ | prop | description | type | default |
168
+ | :------------ | :------------------------------------------------------------------------------------- | :----------------------- | :------ |
169
+ | modelValue | The input values accepted by the component also support two-way binding. | ` String ` | ` '' ` |
170
+ | autofocus | Focus editor immediately after mounted. | ` Boolean ` | ` false ` |
171
+ | disabled | Disable input behavior and disable change state. | ` Boolean ` | ` false ` |
172
+ | indentWithTab | Bind keyboard Tab key event. | ` Boolean ` | ` true ` |
173
+ | tabSize | Specify the indent when the Tab key is pressed. | ` Number ` | ` 2 ` |
174
+ | placeholder | Display when empty. | ` String ` | ` '' ` |
175
+ | style | The CSS style object that acts on the CodeMirror itself. | ` Object ` | ` {} ` |
176
+ | phrases | Codemirror [ internationalization phrases] ( https://codemirror.net/examples/translate/ ) . | ` Object ` | ` {} ` |
177
+ | autoDestroy | Auto destroy the CodeMirror instance before the component unmount. | ` Boolean ` | ` true ` |
178
+ | extensions | Passed to CodeMirror ` EditorState.create({ extensions }) ` | ` Extension ` | ` [] ` |
179
+ | selection | Passed to CodeMirror ` EditorState.create({ selection }) ` | ` EditorSelection ` | - |
180
+ | root | Passed to CodeMirror ` new EditorView({ root }) ` | ` ShadowRoot \| Document ` | - |
180
181
181
182
### Component Events
182
183
0 commit comments