Skip to content
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

Add Tab context to the method in plugin addTab #8336

Merged
merged 1 commit into from May 23, 2023

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

  • Please commit to the dev branch
  • For contributing new features, please supplement and improve the corresponding user guide documents

插件 API addTab 中的 init 等方法的 this 指向的是一个 Custom 对象, 该对象在初始化时传入的 tab 参数由于没有挂载到对象属性中作为上下文, 因此插件无法对其打开的页签进行控制(例如更新标题, 钉住/取消钉住)
The this of methods such as init in the plugin API addTab points to a Custom object, and the tab parameter passed in when the object is initialized is not mounted into the object properties as a context, so the plugin cannot control the tabs it opens (e.g. update title, pin/unpin)

本次提交将页签对象添加到 init 方法的上下文中
This commit adds the tab object to the context of the init method.

@88250 88250 requested a review from Vanessa219 May 23, 2023 10:39
@88250 88250 changed the title 🎨 Add Tab context to the method in plugin addTab 🎨 Add Tab context to the method in plugin addTab May 23, 2023
@88250 88250 modified the milestones: 2.9.0, 2.8.10 May 23, 2023
@Vanessa219 Vanessa219 merged commit 73946e1 into siyuan-note:dev May 23, 2023
2 checks passed
@88250 88250 changed the title 🎨 Add Tab context to the method in plugin addTab Add Tab context to the method in plugin addTab May 23, 2023
@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the feat/plugin-tab-context branch May 24, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants