layUI 父页面获取子页面的变量(数据)

layer.open({
                title: '选择商品',
                    type: 2,
                area:['70%','600px']
                ,content: ''+prefix +'/addGoods?supplier='+suppliers+'&depot='+stock+'',
                btn: ['确定', '关闭'],
                yes: function(index,layero ){
                    var body = layer.getChildFrame('body', index);
                    var  data=window[layero.find('iframe')[0]['name']].totalData;
                    console.log(data);
                    layer.close(index);
                }
            });

你可能感兴趣的:(layui)