inner.html 844 B

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  5. <style type="text/css">
  6. html,
  7. body {
  8. width: 100%;
  9. height: 100%;
  10. margin: 0;
  11. padding: 0;
  12. overflow: hidden;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <div id="container" style="width: 100%; height: 100%"></div>
  18. <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
  19. <script>
  20. require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
  21. require(['vs/editor/editor.main'], function () {
  22. var editor = monaco.editor.create(document.getElementById('container'), {
  23. value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
  24. language: 'javascript'
  25. });
  26. window.onresize = function () {
  27. editor.layout();
  28. };
  29. });
  30. </script>
  31. </body>
  32. </html>