changes
This commit is contained in:
@@ -783,6 +783,17 @@ export default {
|
|||||||
this.form.authors.splice(index, 1);
|
this.form.authors.splice(index, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isImageFile(file) {
|
||||||
|
if (!file) return false;
|
||||||
|
const validTypes = [
|
||||||
|
'image/jpeg',
|
||||||
|
'image/png',
|
||||||
|
'image/webp',
|
||||||
|
'image/jpg'
|
||||||
|
];
|
||||||
|
return validTypes.includes(file.type);
|
||||||
|
},
|
||||||
|
|
||||||
handlePreviewDrop(e) {
|
handlePreviewDrop(e) {
|
||||||
const files = e.dataTransfer.files;
|
const files = e.dataTransfer.files;
|
||||||
if (files.length > 0 && this.isImageFile(files[0])) {
|
if (files.length > 0 && this.isImageFile(files[0])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user