您现在的位置是:首页 > 其他

李清波 2021-02-22 其他 816 复制当前网址

layui.open子页面下拉框无法赋值

找了好久终于找到大佬解决了这个问题


layer.open弹出一个页面的时候,下拉框赋值但不能刷新到选定的值。需要做如下调整:红色部分


layer.open({
      type: 2,
      title: ‘下拉框选中’,
      maxmin: false,
      skin: ‘layui-layer-lan’,
      shadeClose: true, //点击遮罩关闭层
      area : [‘50%’ , ‘56%’],
      content:’/index/1’,//弹框显示的url,对应的页面
      success : function(layero, index)
                  layui.form.render();
                  var iframe = layero.find(‘iframe’)[0].contentWindow;
                   var body = layui.layer.getChildFrame(‘body’, index);
                   body.find("#type").val(3);
                   iframe.layui.form.render(‘select’);
       }
});


文章来源:https://www.liqingbo.com/blog-1752.html

评论