opensumi / core

🚀 A framework helps you quickly build AI Native IDE products.
https://opensumi.com
MIT License
3.01k stars 389 forks source link

[Question] 如何动态改变顶部菜单插槽显示? #3046

Closed Augustjoe closed 1 year ago

Augustjoe commented 1 year ago

描述你的问题(Describe you question here)

![Uploading image.png…]() 想在如图位置加几个按钮,目前已经通过 https://github.com/opensumi/opensumi-module-samples/blob/main/modules/custom-toolbar/README.md 成功实现,但不知道怎么动态实现?

Augustjoe commented 1 year ago

image 补充图片

erha19 commented 1 year ago

@Augustjoe 两种方式:

  1. 自己通过 React 渲染的逻辑自行控制,可以结合一些服务/事件/mobx控制界面上的组件更新
  2. 将该区域作为 Toolbar 区域,通过插件方式控制其上面的图标及展示 https://opensumi.com/zh/docs/extension/contributes/toolbar
stale[bot] commented 1 year ago

此问题已被自动标记为已过时,如果没有进一步的活动,它将被关闭。谢谢您的贡献。 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.