@mybricks/code-editor
v1.1.24
Published
代码编辑器
Downloads
47
Readme
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"
/>
)
}