add: Monaco编辑器

This commit is contained in:
2023-10-14 22:12:19 +08:00
parent d102b47da8
commit d8edc6c28b
6 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
@page "/editor"
<Layout>
<Content>
<div class="editor-zone">
<StandaloneCodeEditor ConstructionOptions="GetEditorConstructionOptions" Id="my-editor-instance"/>
</div>
</Content>
</Layout>
@code {
private StandaloneEditorConstructionOptions GetEditorConstructionOptions(StandaloneCodeEditor editor)
{
return new StandaloneEditorConstructionOptions
{
Language = "yaml"
};
}
}

View File

@@ -0,0 +1,3 @@
.editor-zone {
min-height: calc(100vh - 64px);
}

View File

@@ -27,7 +27,10 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
<script src="_content/BlazorMonaco/jsInterop.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script>
<script src="_framework/blazor.server.js"></script>
</body>
</html>