@mybricks/code-editor

1.1.24 • Public • Published

code-editor

代码编辑器

安装

  npm i @mybricks/code-editor

接口定义

type numOrStr = number | string;

interface Props {
  width?: numOrStr;
  height?: numOrStr;
  value?: string;
  language?: string;
  fontSize: numOrStr;
  theme?: 'light' | 'vs-dark';
  readOnly?: boolean;
  tabSize?: number;
  onChange?: (v: string) => void;
}

使用

  import Editor from '@mybricks/code-editor'

  export default function App() {
    return (
      <Editor 
        width={500} 
        height={400}
        fontSize={16}
        language="javascript"
        theme="vs-dark"
      />
    )
  }

Readme

Keywords

Package Sidebar

Install

npm i @mybricks/code-editor

Weekly Downloads

27

Version

1.1.24

License

ISC

Unpacked Size

23.8 kB

Total Files

4

Last publish

Collaborators

  • yingpengsha
  • z35635
  • letterletter
  • zeeker
  • jacksonliu89
  • jidan.wd
  • tangxiaoxin
  • stuzhaoxing
  • leo306
  • godstream
  • leon_js
  • andyzou
  • mybricks-group