rennzhang / codemirror-editor-vue3

CodeMirror component for Vue3
https://rennzhang.github.io/codemirror-editor-vue3
MIT License
195 stars 39 forks source link

how to use addWidget ? #4

Closed zerocsss closed 2 years ago

zerocsss commented 2 years ago

how to get an instance

cm.addWidget(pos: {line, ch}, node: Element, scrollIntoView: boolean) Puts node, which should be an absolutely positioned DOM node, into the editor, positioned right below the given {line, ch} position. When scrollIntoView is true, the editor will ensure that the entire node is visible (if possible). To remove the widget again, simply use DOM methods (move it somewhere else, or call removeChild on its parent).

rennzhang commented 2 years ago

Do you read the documentation carefully? image In addition, it can be obtained by ref.

zerocsss commented 2 years ago

OK, thanks