code-editor
<vs.code-editor>
基于 Monaco Editor 的代码编辑器。
Examples
Automatic layout - fit-content
Automatic layout - fit-container
Placeholder
Brick Next YAML
Brick Next YAML with highlight
Show CTX.DS
Properties
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | string | |||
label | string | |||
value | string | |||
language | string | "plaintext" | ||
theme | 主题,支持 | string | "auto" | |
required | boolean | |||
readOnly | boolean | |||
automaticLayout | "fit-container" | "fit-content" | "none" | |||
minLines | number | 3 | ||
completers | monaco.languages.CompletionItem[] | |||
advancedCompleters | AdvancedCompleterMap | |||
markers | Marker[] | |||
links | string[] | |||
maxLines | number | Infinity | ||
height | string | number | |||
message | string | |||
placeholder | string | |||
showExpandButton | 是否展示展开按钮 | boolean | ||
lineNumbers | 行数配置 | monaco.editor.LineNumbersType | ||
tokenConfig | 自定义高亮配置 | TokenConfig | ||
customValidationInBrickNextYaml | 在 brick_next_yaml 中是否开启语义相关校验 | boolean | false | |
showCopyButton | 是否展示复制按钮 | boolean | true | |
glyphMargin | 显示字形边距 | boolean | false | |
extraLibs | ExtraLib[] |
Events
Name | Description | Event Detail |
---|---|---|
code.change | string | |
user.input | any | |
token.click | string |
Type references
Marker
Name | Type | Required | Description |
---|---|---|---|
token | string | ✅ | |
level | keyof typeof Level | ||
message | string | ||
code | { value: string; target: string } | ||
params | string[] |
TokenConfig
Name | Type | Required | Description |
---|---|---|---|
showDSKey | boolean | ✅ |
ExtraLib
Name | Type | Required | Description |
---|---|---|---|
filePath | string | ✅ | |
content | string | ✅ |
AdvancedCompleterMap
Record<string, { triggerCharacter: string; completers: monaco.languages.CompletionItem[] }>