简体   繁体   English

在单击摩纳哥编辑器时显示替换面板

[英]Show replace panel on click monaco editor

I'm creating an app using monaco-editor.我正在使用 monaco-editor 创建一个应用程序。 I wanna show the replace panel when I click on a button.我想在单击按钮时显示替换面板。 I searched a lot but I didn't find what I wanted.我搜索了很多,但没有找到我想要的。 I tried that:我试过了:

  window.editor.focus();
  window.editor.getAction('actions.replace').run()

but it didn't work.但它没有用。

To get the replace panel use the action editor.action.startFindReplaceAction .要获取替换面板,请使用操作editor.action.startFindReplaceAction

editor.getAction('editor.action.startFindReplaceAction').run()

If you want list of all the actions available then use the method editor.getActions() which will give the list of all available actions.如果您想要所有可用操作的列表,请使用方法editor.getActions()它将提供所有可用操作的列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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