DTStack / molecule

:rocket: A lightweight Web IDE UI framework.

Home Page:https://dtstack.github.io/molecule/

Repository from Github https://github.comDTStack/moleculeRepository from Github https://github.comDTStack/molecule

编辑器的标签页 Editor tab 如何判断左/右侧是否还有标签页呢?

resetsix opened this issue · comments

Question

我找了许久,没有发现类似于 molecule.editor.getState() 这样的方法中有 tab 已打开数量相关的状态。

因为我想要在最右侧或最左侧 disable 掉无效的关闭选项,但发现判断不了,也没有相关的内置方法。

此处是 disable:true 的效果

图片

我个人的想法是,每打开一个 tab 就放入一个数组中,根据这个数组的内容去判断关闭的逻辑。但还是想挣扎一下有没有更好地办法,如果实在不行就只有土法子上了。

目前 Molecule 没啥特别好的办法去实现这个需求。

目前 tab 的数据是存储在 molecule.editor.getState().groups 中的。然后根据这个 group 下的 data 的数组内容来判断关闭的逻辑。

目前 Molecule 没啥特别好的办法去实现这个需求。

目前 tab 的数据是存储在 molecule.editor.getState().groups 中的。然后根据这个 group 下的 data 的数组内容来判断关闭的逻辑。

貌似 group 下那个的data就是我想寻找的数组hhh。