layui 在一个页面,打开另一个页面,iframe版

在我的客户页面,调整到 我的合同页面:

<div>请去【<a style="color:green" class="toPage" data-type="toPage" >合同管理—我的合同</a>】页面提交审核!</div>

js:

var active = {
          toPage:function () {
              top.layui.index.openTabsPage("order/myOrdersList.jsp", '我的合同');
          }
}

      $("body").on('click','.toPage', function(){
          var type = $(this).data('type');
          active[type] ? active[type].call(this) : '';
      });

打开另一页面(页签) 的关键代码:

 

top.layui.index.openTabsPage("order/myOrdersList.jsp", '我的合同');

转载:https://blog.csdn.net/kuangfengbuyi/article/details/106559834

 

------------------------------------------------------自己项目-------------------------------------------------------------------------------

             <button type="button" data-type="toPage"  class="layui-btn layui-btn-normal toPage">设置分组</button>




 layui.use(['form', 'layedit', 'laydate','jquery','table','element',], function () {
     var form = layui.form;
     $=layui.jquery;
     table = layui.table;
 element = layui.element;


     var active = {
         toPage:function () {
             top.layui.index.openTabsPage("/user/word_group/index", '分组管理');
         }
     };

     $("body").on('click','.toPage', function(){
         var type = $(this).data('type');
         active[type] ? active[type].call(this) : '';
     });

 

 
 
posted @ 2021-01-18 17:37  搬砖小伙子  阅读(2913)  评论(0编辑  收藏  举报