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:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vue3-element-admin",
|
||||
"description": "Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板,vue-element-admin 的 Vue3 版本",
|
||||
"version": "4.8.3",
|
||||
"version": "4.8.4",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
2314
pnpm-lock.yaml
generated
2314
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -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