From a7f39d9ea0a52a7f03a475bb5f6f2334efc4fa24 Mon Sep 17 00:00:00 2001 From: p Date: Fri, 14 Aug 2026 17:00:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20TabPanel.add=5Ftab?= =?UTF-8?q?=20=E7=9A=84=20add=5Fremoveable=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index_tab.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 可能构建失败)