sample.js 632 B

12345678910111213141516171819
  1. // Through the options literal, the behaviour of the editor can be easily customized.
  2. // Here are a few examples of config options that can be passed to the editor.
  3. // You can also call editor.updateOptions at any time to change the options.
  4. var editor = monaco.editor.create(document.getElementById("container"), {
  5. value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line",
  6. language: "javascript",
  7. lineNumbers: "off",
  8. roundedSelection: false,
  9. scrollBeyondLastLine: false,
  10. readOnly: false,
  11. theme: "vs-dark",
  12. });
  13. setTimeout(function() {
  14. editor.updateOptions({
  15. lineNumbers: "on"
  16. });
  17. }, 2000);