I’m building a simple code editor in browser with file tree support. so basically I’ve a single dom element (BTW I’m using VueJS). the page starts with the below defined view
let view = new EditorView({
doc: primaryFile.content,
extensions: Extensions,
parent: editor.value, // vue reference to a div element
})
which works as expected and every thing is perfect
Don’t put CodeMirror data structures in your Vue data. Vue will perform weird magic operations on the stuff it is given as data, which usually breaks 3rd party classes. Just put plain JSON stuff there.