monaco-editor/samples/browser-amd-localized/index.html

31 lines
801 B
HTML
Raw Normal View History

2020-09-02 23:35:10 +08:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<h2>Monaco Editor Localization Sample</h2>
2020-09-21 20:31:41 +08:00
<div id="container" style="width: 800px; height: 600px; border: 1px solid grey"></div>
2020-09-02 23:35:10 +08:00
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
<script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
require.config({
'vs/nls': {
availableLanguages: {
'*': 'de'
}
}
});
require(['vs/editor/editor.main'], function () {
2020-09-21 20:31:41 +08:00
var editor = monaco.editor.create(document.getElementById('container'), {
value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
language: 'javascript'
});
2020-09-02 23:35:10 +08:00
});
</script>
</body>
</html>