clear优化

This commit is contained in:
阿辉
2024-11-19 13:48:01 +08:00
parent 50bcc4346f
commit 495976726e

View File

@@ -17,7 +17,7 @@
</template> </template>
</el-image> </el-image>
<div @click="selectVisiable = true" class="imageHover"></div> <div @click="selectVisiable = true" class="imageHover"></div>
<el-icon v-show="!!data" class="imageCloseHover" :size="16" @click="data = null; onDataChange(null);"> <el-icon v-show="!!data" class="imageCloseHover" :size="16" @click="dataClear">
<Close /> <Close />
</el-icon> </el-icon>
</div> </div>
@@ -192,7 +192,7 @@ const selectedInit = async () => {
}; };
const uploadRef = ref<any>(); const uploadRef = ref<any>();
// 清空状态 // 清空状态
const clear = (dataClear?:boolean) => { const clear = () => {
filterForm.name = ''; filterForm.name = '';
pageForm.page = 1; pageForm.page = 1;
pageForm.limit = 10; pageForm.limit = 10;
@@ -200,8 +200,8 @@ const clear = (dataClear?:boolean) => {
listData.value = []; listData.value = [];
// all数据不能清因为all只会在挂载的时候赋值一次 // all数据不能清因为all只会在挂载的时候赋值一次
// listAllData.value = []; // listAllData.value = [];
if (dataClear) data.value = null;
}; };
const dataClear = () => { data.value = null; onDataChange(null); }
// fs-crud部分 // fs-crud部分
@@ -216,7 +216,7 @@ const onDataChange = (value: any) => {
formValidator.onBlur(); formValidator.onBlur();
}; };
defineExpose({ data, onDataChange, selectVisiable, clear }); defineExpose({ data, onDataChange, selectVisiable, clear, dataClear });
onMounted(() => listRequestAll()); onMounted(() => listRequestAll());