feat: 优化上传组件事件类型提示

master
luoer 2023-10-31 17:53:17 +08:00
parent 2a55bc0fcc
commit ce93e87e38
2 changed files with 8 additions and 2 deletions

View File

@ -97,7 +97,11 @@ import { FileItem, Message, RequestOption, UploadInstance } from "@arco-design/w
import axios from "axios";
import numeral from "numeral";
const emit = defineEmits(["success"]);
const emit = defineEmits<{
(event: "success", item: FileItem): void;
(event: "close", count: number): void;
}>();
const visible = ref(false);
const uploadRef = ref<UploadInstance | null>(null);
const successCount = ref(0);
@ -170,6 +174,7 @@ const onBeforeCancel = () => {
*/
const onClose = () => {
fileList.value = [];
emit("close", successCount.value);
};
/**
@ -230,6 +235,7 @@ defineExpose({
},
});
// TODO
const group = ref("default");
const groupOptions = [
{

View File

@ -94,7 +94,7 @@ const table = useTable({
)}
</div>
<div class="flex flex-col overflow-hidden">
<span class="hover:text-brand-500 cursor-pointer" onClick={() => preview(record)}>
<span class="hover:text-brand-500 hover:decoration-underline underline-offset-2 cursor-pointer" onClick={() => preview(record)}>
{record.name}
</span>
<span class="text-gray-400 text-xs truncate">{numeral(record.size).format("0 b")}</span>