vue + elementUI Upload 上传视频上传格式尺寸宽高时长,限制视频上传格式、尺寸、时长

<video v-if="videoSrc!==''" :src="videoSrc" id="avatar"></video> <i else class="el-icon-video-camera-solid"></i>

关于文件类型:

      switch (this.switchData.type) {

        case '1': this.switchData.accept = 'image/*'; break;

        case '2': this.switchData.accept = 'audio/*'; break;

        case '3': this.switchData.accept = 'video/*'; break;

        case '4': this.switchData.accept = 'application/*'; break;

        case '5': this.switchData.accept = 'application/*'; break;

      }

 isAccept = new RegExp(this.switchData.accept).test( 文件的类型);

猜你喜欢

转载自blog.csdn.net/m0_65720832/article/details/130623835