更改上传图片
This commit is contained in:
parent
6f1677c171
commit
7aecde77d9
@ -247,13 +247,14 @@ export default {
|
||||
},
|
||||
// 上传预处理
|
||||
beforeUpload(file) {
|
||||
console.log(file)
|
||||
if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") {
|
||||
const reader = new FileReader();
|
||||
this.previews.data = file;
|
||||
this.videoForm.showVideoPath = URL.createObjectURL(file);
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => {
|
||||
// this.options.img = reader.result;
|
||||
|
||||
};
|
||||
} else {
|
||||
if (file.type.indexOf("image/") == -1) {
|
||||
@ -266,7 +267,7 @@ export default {
|
||||
this.previews.url = URL.createObjectURL(file);
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => {
|
||||
// this.options.img = reader.result;
|
||||
this.options.img = reader.result;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user