弹窗里的上传组件哪位老哥做过,我做了,点击没反应
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() {
//请求异常回调
}
});
});
}
});
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…