feat: 优化上传组件事件类型提示
parent
2a55bc0fcc
commit
ce93e87e38
|
|
@ -97,7 +97,11 @@ import { FileItem, Message, RequestOption, UploadInstance } from "@arco-design/w
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import numeral from "numeral";
|
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 visible = ref(false);
|
||||||
const uploadRef = ref<UploadInstance | null>(null);
|
const uploadRef = ref<UploadInstance | null>(null);
|
||||||
const successCount = ref(0);
|
const successCount = ref(0);
|
||||||
|
|
@ -170,6 +174,7 @@ const onBeforeCancel = () => {
|
||||||
*/
|
*/
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
|
emit("close", successCount.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -230,6 +235,7 @@ defineExpose({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO
|
||||||
const group = ref("default");
|
const group = ref("default");
|
||||||
const groupOptions = [
|
const groupOptions = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ const table = useTable({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col overflow-hidden">
|
<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}
|
{record.name}
|
||||||
</span>
|
</span>
|
||||||
<span class="text-gray-400 text-xs truncate">{numeral(record.size).format("0 b")}</span>
|
<span class="text-gray-400 text-xs truncate">{numeral(record.size).format("0 b")}</span>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue