feat: 回退页面时,如果页面不存在,则创建并从菜单读取标题

This commit is contained in:
augushong
2025-08-21 22:37:04 +08:00
parent 49a58206d8
commit f2b2b057e2
2 changed files with 16 additions and 4 deletions

View File

@@ -1,13 +1,17 @@
(function () {
var element = layui.element;
$ = layui.$;
var miniTab = {
renderOptions:{},
/**
* 初始化tab
* @param options
*/
render: function (options) {
this.renderOptions = options;
options.filter = options.filter || null;
options.urlHashLocation = options.urlHashLocation || false;
options.maxTabNum = options.maxTabNum || 20;
@@ -180,6 +184,10 @@
* @param menuList
*/
searchMenu: function (href, menuList) {
if(!menuList){
menuList = this.renderOptions.menuList
}
var menu;
for (key in menuList) {
var item = menuList[key];
@@ -393,6 +401,7 @@
listenSwitch: function (options) {
options.filter = options.filter || null;
options.urlHashLocation = options.urlHashLocation || false;
options.listenSwichCallback = options.listenSwichCallback || function () { };
element.on('tab(' + options.filter + ')', function (data) {
var tabId = $(this).attr('lay-id');