简体   繁体   中英

Tabs in Monaco Editor

How do I make tabs in the Monaco editor like Visual Studio Code? For example, this is what I mean. 在此处输入图片说明

There is a quite good explanation on 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. In the event handler, you have to update the model and view state, eg switching between foo.js & foo1.js files.

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:

https://github.com/bootrino/reactoxide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM