Welcome to ZaiZheLe Developer Zone-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

layer,layui的弹窗里加上传组件点击为什么失效

弹窗里的上传组件哪位老哥做过,我做了,点击没反应

initAfterSale() {
            var div = $('.tt').html();
            layer.open({
                type: 1,
                area: ['420px'], //宽高
                content: div,
                success: function(layero, index) {
                    form.render();
                    layui.use('upload', function() {
                        var upload = layui.upload;

                        //执行实例
                        var uploadInst = upload.render({
                            elem: '#test10' //绑定元素
                                ,
                            url: 'http://localhost:8090/blog-web/user/uploadFile' //上传接口
                                ,
                            accept: 'file',
                            done: function(res) {
                                layui.use('layer', function() {
                                    var layer = layui.layer;

                                    layer.msg(res.url, {
                                        time: 6000, //6s后自动关闭
                                        icon: 1
                                    });
                                });
                            },
                            error: function() {
                                //请求异常回调
                            }
                        });
                    });
                }
            });

        }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to ZaiZheLe Developer Zone-Open, Learning and Share
...