@riil-frontend/component-script-editor

intro component

Usage no npm install needed!

<script type="module">
  import riilFrontendComponentScriptEditor from 'https://cdn.skypack.dev/@riil-frontend/component-script-editor';
</script>

README

脚本编辑器组件

支持的语言

import { LANGUAGES } from "@riil-frontend/component-script-editor";

ScriptEditor API

参数名 说明 类型 默认值
value 值,必填 string -
onChange value 变化监听 (value: string) => void -
className 类名 string -
language 编程语言,不传则以纯文本展示, 传入的值必需为支持的语言类型 string -
readOnly 只读模式 bool false
theme 主题,支持设置'vs'、'vs-dark'、'hc-black' string vs
options Monaco编辑器的其他配置 Object -

脚本Diff编辑器 ScriptDiffEditor API

参数名 说明 类型 默认值
value 最新的内容,必填 string -
originalValue 旧的内容,必填 string -
className 类名 string -
language 编程语言,不传则以纯文本展示, 传入的值必需为支持的语言类型 string -
theme 主题,支持设置'vs'、'vs-dark'、'hc-black' string vs
options Monaco编辑器的其他配置 Object -