// class来设置动态样式,根据css来取消加号
<el-upload
:class="{ disabled: uploadDisabled }"
action
:auto-upload="false"
list-type="picture-card"
:on-preview="handlePreview"
:before-remove="beforeRemove"
:on-change="uploadSectionFile"
:on-remove="handleRemove"
:limit="1"
ref="businessLicense"
:file-list="photoList"
>
<i class="el-icon-plus"></i>
</el-upload>
uploadSectionFile(file, fileList) {
if (fileList.length >= 1) {
this.uploadDisabled = true;
}
},
handleRemove(file) {
this.uploadDisabled = false;
},
/deep/ .disabled .el-upload--picture-card {
display: none !important;
}
el-upload上传一张图片,取消加号
最新推荐文章于 2023-12-16 00:07:28 发布