@page "/"
@code {
private string EditorValue = "<div>hello</div>";
private StandaloneEditorConstructionOptions EditorConstructionOptions(StandaloneCodeEditor editor)
{
return new StandaloneEditorConstructionOptions
{
Value = EditorValue,
AutomaticLayout = true,
Language = "html",
Theme = "vs-dark",
};
}
}
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
<StandaloneCodeEditor @bind-Value="EditorValue" CssClass="my-editor-class" Id="my-editor-instance-id" ConstructionOptions="EditorConstructionOptions" />
<div>@(new MarkupString(EditorValue))</div>
@page "/"
@code {
private string EditorValue = "<div>hello</div>";
private StandaloneEditorConstructionOptions EditorConstructionOptions(StandaloneCodeEditor editor)
{
return new StandaloneEditorConstructionOptions
{
Value = EditorValue,
AutomaticLayout = true,
Language = "html",
Theme = "vs-dark",
};
}
}
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
<StandaloneCodeEditor @bind-Value="EditorValue" CssClass="my-editor-class" Id="my-editor-instance-id" ConstructionOptions="EditorConstructionOptions" />
<div>@(new MarkupString(EditorValue))</div>