html:
<a-upload
v-model:file-list="fileList"
list-type="picture-card"
:before-upload="beforeUpload"
@change="handleChange"
:show-upload-list="false"
:customRequest="customImageRequest"
>
<div class="upload-box" v-if="imageUrl">
<img :src="imageUrl" alt="avatar" />
<div class="delete" @click="delteImg">
<DeleteOutlined />
</div>
</div>
<div v-else>
<plus-outlined />
<div class="ant-upload-text">上传签名</div>
</div>
</a-upload>
js:
// 图片压缩成base64 function getBase64(img: Blob, callback: (base64Url: string) => void) { const reader = new FileReader(); reader.addEventLis