0
これはtest.html
ファイルのHTMLコードのスニペットです。モナコエディタでファイルのパスを設定する方法は?
<script src="monaco-editor/min/vs/loader.js"></script>
<script>
\t require.config({ paths: { 'vs': 'monaco-editor/min/vs' }});
\t require(['vs/editor/editor.main'], function() {
\t \t var editor = monaco.editor.create(document.getElementById('container'), {
\t \t \t value: [
\t \t \t \t 'function x() {',
\t \t \t \t '\tconsole.log("Hello world!");',
\t \t \t \t '}'
\t \t \t ].join('\n'),
\t \t \t language: 'javascript'
\t \t });
\t });
</script>
これは私のシステム上のファイルツリーです。
ide ├── cpp14 │ ├── test.html ├── monaco └── node_modules ├── monaco-editor └── test.html
私はmonaco/node_moules/
からcpp14
にtest.html
ファイルをコピーし、これが動作していないと私はそこだと思う
<script src="ide/monaco/node_modules/monaco-editor/min/vs/loader.js"></script>
<script>
\t require.config({ paths: { 'vs': 'ide/monaco/node_modules/monaco-editor/min/vs' }});
\t require(['ide/monaco/node_modules/monaco-editor/min/vs/editor/editor.main'], function() {
\t \t var editor = monaco.editor.create(document.getElementById('container'), {
\t \t \t value: [
\t \t \t \t 'function x() {',
\t \t \t \t '\tconsole.log("Hello world!");',
\t \t \t \t '}'
\t \t \t ].join('\n'),
\t \t \t language: 'javascript'
\t \t });
});
にcpp14/test.html
内のすべてのパスを変更エラーですこれらのファイルのパスをスニペットに設定することができます。 この作品を作成するには?