问题:
上传视频的时候,触发on-preview函数 ,发现返回的file里面有的有url属性,有的没有,导致回显预览有问题。
解决方法:
在函数中添加file.url = URL.createObjectURL(file.raw)
handlePictureCardPreview(file) {
//解决视频回显没有url的问题
if (!file.url) {
file.url = URL.createObjectURL(file.raw);
}
this.dialogImageUrl = file.url;
console.log(this.dialogImageUrl, "路径");
this.imgDialogVisible = true;
},