creating-the-editor-editor-basic-options.js 1.0 KB

123
  1. // This is a generated file. Please do not edit directly.
  2. var SAMPLES = this.SAMPLES || [];
  3. SAMPLES.push({"id":"creating-the-editor-editor-basic-options","js":"//---------------------------------------------------\n// Creating the editor > Editor basic options\n//---------------------------------------------------\n\n// Through the options literal, the behaviour of the editor can be easily customized.\n// Here are a few examples of config options that can be passed to the editor.\n// You can also call editor.updateOptions at any time to change the options.\n\nvar editor = monaco.editor.create(document.getElementById(\"container\"), {\n\tvalue: \"// First line\\nfunction hello() {\\n\\talert('Hello world!');\\n}\\n// Last line\",\n\tlanguage: \"javascript\",\n\n\tlineNumbers: false,\n\troundedSelection: false,\n\tscrollBeyondLastLine: false,\n\treadOnly: false,\n\ttheme: \"vs-dark\",\n});\nsetTimeout(function() {\n\teditor.updateOptions({\n\t\tlineNumbers: true\n\t});\n}, 2000);\n","html":"<div id=\"container\" style=\"height:100%;\"></div>\n","css":""});