diff --git a/wwwroot/index_tab.js b/wwwroot/index_tab.js index 98e33f2..1a30ed5 100644 --- a/wwwroot/index_tab.js +++ b/wwwroot/index_tab.js @@ -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 可能构建失败)