Layui Mini 框架:如何打开已存在的 iframe tab 页
可以尝试使用layui.miniTab.openTab方法打开现有的iframe tab页,例如:
layui.miniTab.openTab({
id: 'merchant/index', // tab页的id,保证唯一性
title: '商户首页', // tab页的标题
url: 'merchant/index.html', // iframe的url地址
icon: 'fa fa-home', // tab页的图标
});
其中,id参数要保证唯一性,可以使用类似于路由的方式来定义。例如,merchant/index表示商户的首页,user/index表示用户的首页,以此类推。在打开新的iframe tab页时,也可以使用同样的方式。
AI 优化版
原文地址:https://www.cveoy.top/t/topic/ouyn 著作权归作者所有。请勿转载和采集!