Skip to content

代码编辑器(CodeEditor)

组件标识

component: 'CodeEditor'

componentProps

参数名类型说明
language'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'scss' | 'python' | 'java' | 'cpp' | 'csharp' | 'php' | 'go' | 'rust' | 'sql' | 'markdown' | 'xml' | 'yaml'编程语言
theme'vs' | 'vs-dark' | 'hc-black'编辑器主题
heightstring | number编辑器高度
fontSizenumber字体大小
tabSizenumberTab 宽度
lineNumbers'on' | 'off' | 'relative' | 'interval'行号显示方式
wordWrap'on' | 'off' | 'wordWrapColumn' | 'bounded'自动换行策略
minimapboolean是否显示小地图
readOnlyboolean只读模式
onMount(editor: any) => void编辑器挂载回调
styleRecord<string, any>自定义样式