百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-monaco-editor

> 前端框架
开源

用于 React 的 Monaco 编辑器

4.2K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于 React 的 Monaco 编辑器

React-monaco-editor

## 示例 要在本地构建示例,请运行: ```bash yarn cd example yarn yarn start ``` 然后在浏览器中打开 `http://localhost:8886`。 ## 安装 ```bash yarn add react-monaco-editor ``` ## 与 Webpack 结合使用 ``` … ``` 将 [Monaco Webpack 插件](https://github.com/Microsoft/monaco-editor-webpack-plugin) `monaco-editor-webpack-plugin` 添加到您的 `webpack.config.js`: ```js const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); module.exports = { plugins: [ new MonacoWebpackPlugin({ // available options are documented at https://github.com/microsoft/monaco-editor/blob/main/webpack-plugin/README.md#options languages: ['json'] }) ] }; ``` 附注: Monaco Editor 内部使用 CSS 导入,因此如果您在项目中使用 CSS 模块,则默认会出现冲突。为了避免这种情况,请为应用程序和 monaco-editor 包单独配置 css-loader: ```js // Specify separate paths const path = require('path'); const APP_DIR = path.resolve(__dirname, './src'); const MONACO_DIR = path.resolve(__dirname, './node_modules/monaco-editor');

{ test: /.css$/, include: APP_DIR, use: [{ loader: 'style-loader', }, { loader: 'css-loader', options: { modules: true, namedExport: true, }, }], }, { test: /.css$/, include: MONACO_DIR, use: ['style-loader', 'css-loader'], }

## 属性
下面所有属性都是可选的.

- 编辑宽度。 默认为"100Q".
- 编辑的高度。 默认为"100Q".
- 编辑器中创建的汽车的`价值 ' 价值。
- 编辑器中创建的汽车模型的初始值`defaultValue'。
- " 语言 " -- -- 汽车的初始语言在编辑器中创建了模型。
- 编辑主题
- " 选项 " 是指[摩纳哥接口ISTANDONIONEDROION EDEATION Construction Options](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html)。
- " 管理服务 " 指[摩纳哥接口编辑服务](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IEditorOver)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScripteditormonaco-editorreact

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架