fix: 修复生产打包编译报错的问题

This commit is contained in:
郝先瑞
2022-03-14 00:24:34 +08:00
parent c5be8a6a58
commit 7fc574e00d
5 changed files with 10 additions and 10 deletions

View File

@@ -56,7 +56,7 @@ const props = defineProps({
},
});
const imgUrl = computed<string | null>({
const imgUrl = computed<string | undefined>({
get() {
return props.modelValue;
},
@@ -79,12 +79,12 @@ async function uploadImage(options: UploadRequestOptions): Promise<any> {
/**
* 删除图片
*
* @param file
* @param fileUrl
*/
function handleRemove(file: UploadFile, fileList: UploadFile[]) {
if (file) {
deleteFile(file.url);
imgUrl.value = null; // 这里会触发imgUrl的computed的set方法
function handleRemove(fileUrl?: string) {
if (fileUrl) {
deleteFile(fileUrl);
imgUrl.value = undefined; // 这里会触发imgUrl的computed的set方法
}
}
/**