fix: 修复 TabPanel.add_tab 的 add_removeable bug
This commit is contained in:
parent
7b7d76f4aa
commit
a7f39d9ea0
@ -5,6 +5,12 @@
|
||||
if (bricks.TabPanel.prototype._dyn_patched) return;
|
||||
bricks.TabPanel.prototype._dyn_patched = true;
|
||||
|
||||
// 修复原生 add_tab 的 bug:this.add_removeable 不存在(应为 toolbar.add_removable),
|
||||
// 且 createTool 内部已调用 add_removable,这里只需创建 tool 按钮
|
||||
bricks.TabPanel.prototype.add_tab = function(desc){
|
||||
this.toolbar.createTool(desc);
|
||||
};
|
||||
|
||||
// 动态打开 tab:已存在(opts.items 同名)则切换,不存在则新增
|
||||
bricks.TabPanel.prototype.open_tab = async function(desc){
|
||||
// 1. 已存在判断:opts.items 里找同名(不用 content_buffer,因 content 可能构建失败)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user