fix: defineModel 泛型写法适配 Vue 3.5 + vue-tsc 3.x,修复 26 个 TS 编译错误

- Upload 组件 defineModel 改用泛型 defineModel<T>({ default }) 替代旧的 type + PropType 写法
- 版本号 4.8.3 → 4.8.4
This commit is contained in:
Ray.Hao
2026-07-31 17:28:20 +08:00
parent 48f0ac118c
commit 09088815cc
5 changed files with 1011 additions and 1321 deletions

View File

@@ -114,11 +114,7 @@ const props = defineProps({
},
},
});
const modelValue = defineModel("modelValue", {
type: [Array] as PropType<FileInfo[]>,
required: true,
default: () => [],
});
const modelValue = defineModel<FileInfo[]>({ required: true, default: () => [] });
const fileList = ref([] as UploadFile[]);

View File

@@ -86,10 +86,7 @@ const props = defineProps({
const previewVisible = ref(false); // 是否显示预览
const previewImageIndex = ref(0); // 预览图片的索引
const modelValue = defineModel("modelValue", {
type: [Array] as PropType<string[]>,
default: () => [],
});
const modelValue = defineModel<string[]>({ default: () => [] });
const fileList = ref<UploadUserFile[]>([]);

View File

@@ -83,10 +83,7 @@ const props = defineProps({
},
});
const modelValue = defineModel("modelValue", {
type: String,
default: () => "",
});
const modelValue = defineModel<string>({ default: "" });
/**
* 限制用户上传文件的格式和大小