html:

<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-normal" >
</div>

js:

//多文件自动上传
var demoListView = $('#demoList')
, uploadListIns = upload.render({
elem: '#testList'
, url: 'UploadKeepImg'
, accept: 'jpg|png'
, multiple: true
, number: 2
, auto: true
, before: function (obj) {
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
obj.preview(function (index, file, result) {
var tr = $(['<tr >上传失败</span>');
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
}
});

参考文章:

https://fly.layui.com/jie/26134/

https://www.cnblogs.com/zhaopanpan/articles/9927548.html

相关文章: