Skip to content

CodeEditor 代码编辑器

基本使用

TIP

集成了 Es6 模块,可查看控制台打印

tsx
import { CodeEditor } from "@yl_lowcode/editor";

export default () => {
  return (
    <CodeEditor
      style={{ height: 400 }}
      onChange={(code: string, res: any) => {
        console.log(code, res);
      }}
      value={`export default {
  number: 100,
  add: () => {
    console.log("add");
  },
}`}
    />
  );
};