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:
@@ -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[]);
|
||||
|
||||
|
||||
@@ -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[]>([]);
|
||||
|
||||
|
||||
@@ -83,10 +83,7 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const modelValue = defineModel("modelValue", {
|
||||
type: String,
|
||||
default: () => "",
|
||||
});
|
||||
const modelValue = defineModel<string>({ default: "" });
|
||||
|
||||
/**
|
||||
* 限制用户上传文件的格式和大小
|
||||
|
||||
Reference in New Issue
Block a user