只需在value='console.log("Hello");\n'
我想添加更多的javascript行,例如:
// assign variables
var myArray = []
myArray[3] = "hello"
console.log(myArray);
我尝试使用\ n,但运气不佳。
这是Codemirror组件:
<CodeMirror
value='console.log("Hello");\n'
options={{
mode: "javascript",
theme: "material",
lineNumbers: true,
readOnly: true,
}}
onChange={(editor, data, value) => {}}
/>