<TuiEditor @bind-Value="markdown" Options="options1"></TuiEditor>
<TuiEditor @bind-Value="markdown" Options="options2"></TuiEditor>
@code{
private string markdown = "# Init Title";
TuiEditorOptions options1 = new()
{
PreviewStyle = "vertical",
// ToolbarItems = new[] {"heading", "bold", "italic"}
};
TuiEditorOptions options2 = new()
{
Viewer = true
};
}
参数名 | 类型 | 描述 | 默认值 |
---|---|---|---|
Height | string | Editor's height style value. Height is applied as border-box ex) '300px', '100%', 'auto' | |
MinHeight | string | Editor's min-height style value in pixel ex) '300px' | |
PreviewStyle | string | Markdown editor's preview style (tab, vertical) | tab |
InitialEditType | string | Initial editor type (markdown, wysiwyg) | markdown |
Language | string | language | zh-CN |
PreviewHighlight | bool? | Highlight a preview element corresponds to the cursor position in the markdwon editor | true |
UseCommandShortcut | bool? | whether use keyboard shortcuts to perform commands | true |
UseDefaultHTMLSanitizer | bool? | use default htmlSanitizer | true |
UsageStatistics | bool? | send hostname to google analytics | false |
ToolbarItems | IEnumerable<string> | toolbar items. | [heading,bold,italic,strike,divider,hr,quote,divider,ul,ol,task,indent,outdent,divider,table,image,link,divider,code,codeblock] |
Height | bool | ||
HideModeSwitch | bool? | hide mode switch tab bar | true |
Placeholder | string | The placeholder text of the editable element. | |
FrontMatter | bool? | whether use the front matter | true |
Viewer | bool? | 是否是预览器 | false |
文档