[英]Tabs in Monaco Editor
There is a quite good explanation on monaco-editor GitHub . monaco-editor GitHub上有很好的解释。
The tab is just a visual representation of Radio Button or Simple Button for example, where you have to subscribe onChange event.例如,该选项卡只是 Radio Button 或 Simple Button 的可视化表示,您必须在其中订阅 onChange 事件。 In the event handler, you have to update the model and view state, eg switching between foo.js & foo1.js files.
在事件处理程序中,您必须更新模型和视图状态,例如在 foo.js 和 foo1.js 文件之间切换。
editor.setModel(data[desiredModelId].model);
editor.restoreViewState(data[desiredModelId].state);
I had the requirement for Monaco editor with tabs and built this project which you can use as the license is MIT:我需要带有选项卡的摩纳哥编辑器并构建了这个项目,您可以使用该项目,因为许可证是 MIT:
https://github.com/bootrino/reactoxide https://github.com/bootrino/reactoxide
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.