<el-upload
:disabled="showUpload"
class="upload-demo"
ref="uploadRef"
action="#"
:multiple="multiple == 'image'?true:false"
:show-file-list="false"
:before-upload="beforeUpload"
:on-exceed="handleExceed"
:limit="dialogParam.limit"
:accept="dialogParam.accept"
:http-request="uploadFiles"
>
<el-button @click="handleUpload" type="primary">上传</el-button>
<span v-if="dialogParam.type == 'image'" style="margin-left:10px">图片规格:jpg格式、大小15mb内</span>
<span v-else style="margin-left:10px">视频规格:mp4、mv4格式,大小300mb内</span>
</el-upload>
// 点击上传前做判断
const handleUpload = async() => {
if(dataList.value.length>=30){
ElMessageBox.alert('待添加区图片不能超过30张', '提示', {
confirmButtonText: 'OK',
})
return false
}else{
showUpload.value = false
}
}