I am using codemirror 6.0 I would like to add placeholder function, can you teach me? The documentation says to introduce an extension, how to introduce this extension, please give me a sample, thank you Waiting online!
Something like this -
import { basicSetup } from 'codemirror';
import { EditorView, placeholder } from "@codemirror/view";
import { EditorState } from "@codemirror/state";
let startState = EditorState.create({
extensions: [
placeholder("Write your placeholder text here"),
basicSetup
]
});
let view = new EditorView({
state: startState,
parent: yourRefHere,
plugin: []
});