File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,10 @@ To use `svelte-codemirror-editor`, you need to import the package and use it as
47
47
48
48
## Events
49
49
50
- | Event | Type | Description |
51
- | -------- | -------- | ----------------------------- |
52
- | ` change ` | ` string ` | Trigger when the code changes |
50
+ | Event | Type | Description |
51
+ | -------- | ------------ | ------------------------------------------------------------------------------- |
52
+ | ` change ` | ` string ` | Trigger when the code changes. |
53
+ | ` ready ` | ` EditorView ` | Trigger when the editor is ready. Allows to retrieve the ` EditorView ` instance. |
53
54
54
55
## Usage with vite / svelte-kit
55
56
@@ -118,6 +119,17 @@ const config = {
118
119
/>
119
120
```
120
121
122
+ ### Get EditorView instance
123
+
124
+ ``` svelte
125
+ <script lang="ts">
126
+ import CodeMirror from "svelte-codemirror-editor";
127
+ let view: EditorView;
128
+ </script>
129
+
130
+ <CodeMirror on:ready={(e) => view = e.detail} />
131
+ ```
132
+
121
133
## License
122
134
123
135
[ MIT] ( LICENSE )
You can’t perform that action at this time.
0 commit comments