fix(SingleUpload.vue): 修复handleRemove的TypeScript编译报错问题
This commit is contained in:
@@ -89,10 +89,12 @@ function handleExceed(files: UploadFile[]) {
|
||||
*
|
||||
* @param file
|
||||
*/
|
||||
function handleRemove(file: string) {
|
||||
function handleRemove(file: string | null) {
|
||||
if (file) {
|
||||
deleteFile(file)
|
||||
imgUrl.value = null // 这里会触发imgUrl的computed的set方法
|
||||
}
|
||||
}
|
||||
|
||||
function handleBeforeUpload(file: any) {
|
||||
const isJPG = file.type === 'image/jpeg'
|
||||
@@ -120,16 +122,19 @@ function handleBeforeUpload(file: any) {
|
||||
&:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&-image {
|
||||
width: 146px;
|
||||
height: 146px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
&-remove-icon {
|
||||
font-size: 12px;
|
||||
color: #ff4d51 !important;
|
||||
|
||||
Reference in New Issue
Block a user