From bddd04bd785755e9fa27d68b54ce6f40af905e10 Mon Sep 17 00:00:00 2001 From: zhaojinfeng <121016171@qq.com> Date: Thu, 14 Sep 2023 13:27:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20limit=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/upload-list/index.vue | 5 ++++- stories/UploadList.stories.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/upload-list/index.vue b/packages/upload-list/index.vue index dbcb5df..8248c81 100644 --- a/packages/upload-list/index.vue +++ b/packages/upload-list/index.vue @@ -2,7 +2,7 @@ * @Author: zhaojinfeng 121016171@qq.com * @Date: 2023-08-16 17:33:41 * @LastEditors: zhaojinfeng 121016171@qq.com - * @LastEditTime: 2023-09-14 12:57:29 + * @LastEditTime: 2023-09-14 13:26:42 * @FilePath: \vue3\packages\upload-list\index.vue * @Description: * @@ -15,6 +15,7 @@ :before-upload="beforeUpload" :http-request="httpRequest" :list-type="listType" + :limit="limit" @preview="preview" @success="success" @remove="remove" @@ -50,6 +51,8 @@ const props = withDefaults( maxsize?: number /** 文件列表的类型 */ listType?: 'text' | 'picture' | 'picture-card' + /** 允许上传文件的最大数量 */ + limit?: number }>(), { fileList: () => [], maxsize: 100, diff --git a/stories/UploadList.stories.ts b/stories/UploadList.stories.ts index 6af31a7..0828f8e 100644 --- a/stories/UploadList.stories.ts +++ b/stories/UploadList.stories.ts @@ -2,7 +2,7 @@ * @Author: zhaojinfeng 121016171@qq.com * @Date: 2023-08-16 17:33:41 * @LastEditors: zhaojinfeng 121016171@qq.com - * @LastEditTime: 2023-09-14 13:21:59 + * @LastEditTime: 2023-09-14 13:25:41 * @FilePath: \vue3\stories\UploadList.stories.ts * @Description: * @@ -59,6 +59,7 @@ const meta = { filePath: '/', maxsize: 100, listType: 'text', + limit: 12, }, argTypes: { listType: {