跳到主要内容

code-editor

<vs.code-editor>

基于 Monaco Editor 的代码编辑器。

Playground

Examples

Automatic layout - fit-content

Playground

Automatic layout - fit-container

Playground

Placeholder

Playground

Brick Next YAML

Playground

Brick Next YAML with highlight

Playground

Show CTX.DS

Playground

Properties

NameDescriptionTypeDefaultRequired
namestring
labelstring
valuestring
languagestring "plaintext"
theme

主题,支持 "auto" | "vs" | "vs-dark"

string "auto"
requiredboolean
readOnlyboolean
automaticLayout"fit-container" | "fit-content" | "none"
minLinesnumber 3
completersmonaco.languages.CompletionItem[]
advancedCompletersAdvancedCompleterMap
markersMarker[]
linksstring[]
maxLinesnumber Infinity
heightstring | number
messagestring
placeholderstring
showExpandButton

是否展示展开按钮

boolean
lineNumbers

行数配置

monaco.editor.LineNumbersType
tokenConfig

自定义高亮配置

TokenConfig
customValidationInBrickNextYaml

在 brick_next_yaml 中是否开启语义相关校验

boolean false
showCopyButton

是否展示复制按钮

boolean true
glyphMargin

显示字形边距

boolean false
extraLibsExtraLib[]

Events

NameDescriptionEvent Detail
code.changestring
user.inputany
token.clickstring

Type references

Marker

NameTypeRequiredDescription
tokenstring
levelkeyof typeof Level
messagestring
code{ value: string; target: string }
paramsstring[]

TokenConfig

NameTypeRequiredDescription
showDSKeyboolean

ExtraLib

NameTypeRequiredDescription
filePathstring
contentstring

AdvancedCompleterMap

Record<string, { triggerCharacter: string; completers: monaco.languages.CompletionItem[] }>