From cab5beaca7c4750c3a559439abcc24f999b86631 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 5 Mar 2025 18:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9Edisabled=E5=B1=9E=E6=80=A7&=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/FileUpload/index.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index 7db68b51..03c3d55b 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -13,6 +13,7 @@ :headers="headers" class="upload-file-uploader" ref="fileUpload" + v-if="!disabled" > 选取文件 @@ -32,7 +33,7 @@ {{ getFileName(file.name) }}
- 删除 + 删除
@@ -50,22 +51,27 @@ export default { // 数量限制 limit: { type: Number, - default: 5, + default: 5 }, // 大小限制(MB) fileSize: { type: Number, - default: 5, + default: 5 }, // 文件类型, 例如['png', 'jpg', 'jpeg'] fileType: { type: Array, - default: () => ["doc", "xls", "ppt", "txt", "pdf"], + default: () => ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf"] }, // 是否显示提示 isShowTip: { type: Boolean, default: true + }, + // 禁用组件(仅查看文件) + disabled: { + type: Boolean, + default: false } }, data() {