feat: 优化上传组件事件类型提示
parent
2a55bc0fcc
commit
ce93e87e38
|
|
@ -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 = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue