Skip to content

FR: 页签元素新增属性 #12695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TCOTC opened this issue Oct 3, 2024 · 1 comment
Closed

FR: 页签元素新增属性 #12695

TCOTC opened this issue Oct 3, 2024 · 1 comment
Assignees

Comments

@TCOTC
Copy link
Contributor

TCOTC commented Oct 3, 2024

01 添加一个属性,值是文档 id

想通过 JS 实现禁止关闭特定页签的功能,需要按文档 id 找到页签

02 添加一个属性,值是笔记本 id

在写一个代码片段,要判断最后聚焦的文档页签所在的笔记本。

需要思源在页签元素上添加一个属性,值是笔记本 id(如果页签不是文档的话就不需要添加这个属性了):

p.s. 属性名可以叫 data-box 之类的
p.s.s. 其实值是 path 也行,毕竟 path 的开头就是笔记本 id

image


当然,如果有其他方便的办法能获取最后聚焦的文档页签所在的笔记本,这个属性可能就没必要加了

@TCOTC TCOTC changed the title 在页签元素上添加一个属性,值是笔记本 id FR: 页签元素新增属性 Oct 7, 2024
@Vanessa219
Copy link
Member

使用 getAllModels 获取编辑器页签对象,需要的值都在里面了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants