From 6a94b96a6cdbd18846b1986954ddceb6bd497843 Mon Sep 17 00:00:00 2001 From: p Date: Fri, 14 Aug 2026 16:18:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20open=5Ftab=20=E7=94=A8=20opts.items=20?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=B7=B2=E5=AD=98=E5=9C=A8=EF=BC=8Ccontent?= =?UTF-8?q?=20=E5=A4=B1=E8=B4=A5=E4=B9=9F=E8=AE=B0=E5=BD=95=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E9=87=8D=E5=A4=8D=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index_tab.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/wwwroot/index_tab.js b/wwwroot/index_tab.js index a9f601c..57ba462 100644 --- a/wwwroot/index_tab.js +++ b/wwwroot/index_tab.js @@ -5,24 +5,35 @@ if (bricks.TabPanel.prototype._dyn_patched) return; bricks.TabPanel.prototype._dyn_patched = true; - // 动态打开 tab:已存在则切换,不存在则新增 + // 动态打开 tab:已存在(opts.items 同名)则切换,不存在则新增 bricks.TabPanel.prototype.open_tab = async function(desc){ - if (this.content_buffer.hasOwnProperty(desc.name)){ + // 1. 已存在判断:opts.items 里找同名(不用 content_buffer,因 content 可能构建失败) + var existing = null; + for (var i=0;i