sync:修复上传删除文件问题 00ac44d1df
parent
ff9211e557
commit
00f57159b4
|
@ -48,6 +48,8 @@
|
||||||
import uploadImage from './upload-image.vue';
|
import uploadImage from './upload-image.vue';
|
||||||
import uploadFile from './upload-file.vue';
|
import uploadFile from './upload-file.vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
import { isEmpty } from 'lodash-es';
|
||||||
|
|
||||||
let fileInput = null;
|
let fileInput = null;
|
||||||
/**
|
/**
|
||||||
* FilePicker 文件选择上传
|
* FilePicker 文件选择上传
|
||||||
|
@ -516,11 +518,18 @@
|
||||||
* @param {Object} index
|
* @param {Object} index
|
||||||
*/
|
*/
|
||||||
delFile(index) {
|
delFile(index) {
|
||||||
|
if (!isEmpty(this.files)) {
|
||||||
this.$emit('delete', {
|
this.$emit('delete', {
|
||||||
tempFile: this.files[index],
|
tempFile: this.files[index],
|
||||||
tempFilePath: this.files[index].url,
|
tempFilePath: this.files[index].url,
|
||||||
});
|
});
|
||||||
this.files.splice(index, 1);
|
this.files.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
this.$emit('delete', {
|
||||||
|
tempFilePath: this.url,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.setEmit();
|
this.setEmit();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue