This commit is contained in:
xingyu4j
2025-05-26 14:49:12 +08:00
24 changed files with 2229 additions and 46 deletions

View File

@@ -58,7 +58,7 @@ const props = withDefaults(
showDescription: false,
},
);
const emit = defineEmits(['change', 'update:value', 'delete']);
const emit = defineEmits(['change', 'update:value', 'delete', 'returnText']);
const { accept, helpText, maxNumber, maxSize } = toRefs(props);
const isInnerOperate = ref<boolean>(false);
const { getStringAccept } = useUploadType({
@@ -125,6 +125,10 @@ const handleRemove = async (file: UploadFile) => {
};
const beforeUpload = async (file: File) => {
// 使用现代的Blob.text()方法替代FileReader
const fileContent = await file.text();
emit('returnText', fileContent);
const { maxSize, accept } = props;
const isAct = checkFileType(file, accept);
if (!isAct) {