<input type="file" id="input" @change="chooseVideoInput" class="uploadVideo_input"> var video = document.getElementById("video"); var canvas = document.createElement("canvas"); var scale = 1; canvas.width = video.videoWidth * scale; canvas.height = video.videoHeight * scale; canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height); var img = document.createElement("img"); // 创建img img.src = canvas.toDataURL("image/png"); // 设置图片src