groovy语法编辑器
安装
npm install --save-dev groovy-edit-react
使用
<GroovyEditor
defaultCode={defaultCode}
readOnly={true}
height={300}
theme="night"
activeLine={true}
fold={true}
keywords=["const", "var"]
onChange={(code) => this.getCode(code)}
/>
keywords: ["const", "var"],
参数 | 类型 | 默认值 | 是否必填 | 说明 |
---|---|---|---|---|
defaultCode | string | "" | 非必填 | 初始化赋值 |
code | string | "" | 非必填 | |
readOnly | boolean | false | 非必填 | 设置只读 |
height | number | 300 | 非必填 | 编辑器高度 |
theme | string | "day" | 非必填 | 主题:"day"和"night" |
activeLine | boolean | true | 非必填 | 当前行选中标识 |
fold | boolean | true | 非必填 | 代码折叠 |
keywords | array | [] | 非必填 | 自定义提示关键词 |
onChange | function | 无 | 非必填 | 返回code |
MIT