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