From 50bcc4346fdce6727eb8e7a66fd9e34179ad3033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=BE=89?= Date: Tue, 19 Nov 2024 13:42:34 +0800 Subject: [PATCH] =?UTF-8?q?clear=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/fileSelector/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/components/fileSelector/index.vue b/web/src/components/fileSelector/index.vue index 4890c3b..5808447 100644 --- a/web/src/components/fileSelector/index.vue +++ b/web/src/components/fileSelector/index.vue @@ -192,7 +192,7 @@ const selectedInit = async () => { }; const uploadRef = ref(); // 清空状态 -const clear = () => { +const clear = (dataClear?:boolean) => { filterForm.name = ''; pageForm.page = 1; pageForm.limit = 10; @@ -200,7 +200,7 @@ const clear = () => { listData.value = []; // all数据不能清,因为all只会在挂载的时候赋值一次 // listAllData.value = []; - // data.value = null; + if (dataClear) data.value = null; }; @@ -215,8 +215,10 @@ const onDataChange = (value: any) => { formValidator.onChange(); formValidator.onBlur(); }; + defineExpose({ data, onDataChange, selectVisiable, clear }); + onMounted(() => listRequestAll());