Add Tab
context to the method in plugin addTab
#8336
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
插件 API
addTab
中的init
等方法的this
指向的是一个Custom
对象, 该对象在初始化时传入的tab
参数由于没有挂载到对象属性中作为上下文, 因此插件无法对其打开的页签进行控制(例如更新标题, 钉住/取消钉住)The
this
of methods such asinit
in the plugin APIaddTab
points to aCustom
object, and thetab
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.