From 34d05cfae308915b09f54ae07c8f793a5f7e4150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20upload=20=E5=BD=93?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E6=A1=86?= =?UTF-8?q?=E5=B9=B6=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/upload.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/upload.js b/src/modules/upload.js index 93520c9d..e2b57b65 100644 --- a/src/modules/upload.js +++ b/src/modules/upload.js @@ -588,8 +588,11 @@ layui.define(['lay','layer'], function(exports){ that.elemFile.off('upload.change').on('upload.change', function(){ var files = this.files || []; + if(files.length === 0) return; + extendAttrs.call(this); setChooseFile(files); + options.auto ? that.upload() : setChooseText(files); // 是否自动触发上传 });