vue element上传成功后 怎么去除提示请上传文件的提示信息
<el-form-item label="上传文件:" style="margin-left: 65px;" v-model="ruleForm.file" prop="file" :rules="{ required: true, message: '请上传图片', trigger: 'change' }"> <el-upload el-upload class="avatar-uploader el-upload--text" ref="upload" :limit="1" :on-remove="handleRemove" :on-change="handleChange" :file-list="vedioList" :action="uploadUrl" :before-upload="beforeUploadVedio" :on-success="handleVideoSuccess" > <i class="el-icon-plus avatar-uploader-icon" v-show="vedioList.length<1"></i> </el-upload> <P v-if="isShowUploadVideo" class="text">请保证视频格式正确,且不超过20M</P> </el-form-item>
解决办法:上传组件on-success
后执行clearValidate
清除file
的校验信息
handleAvatarSuccess(res, file, fileList) { this.$refs.form.clearValidate('path') this.$notify.success(res.data.F_FileName + "文件上传成功"); },