Hi
in version “^4.0.6” i used code such that to get ref value
function getValue(item){
let doc = this.$refs.cmEditor.codemirror.getDoc();
doc.replaceSelection(`{${item}}`);
}
template was :
<codemirror ref="cmEditor" v-model="form.body" />
today i tried to us it in v.6
function getValue(item:string) {
**const test = varBody.value.state.doc()** // why that doesn't work?
temlates.value.body = `{${item}}`;
}
template
<codemirror
ref="cmEditor"
v-model="form.body"
/>
why that doesn’t work? why i can’t get ref value?
should u give me advice how is’t working?
task: click on div with some value, this value pass to textarea codemirror. than i can change cursor, click to div and add new val.