|
@@ -11,6 +11,7 @@
|
|
|
:http-request="handleImage"
|
|
:http-request="handleImage"
|
|
|
:before-upload="handleBeforeImage"
|
|
:before-upload="handleBeforeImage"
|
|
|
:on-exceed="handleExceed"
|
|
:on-exceed="handleExceed"
|
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
:limit="1"
|
|
:limit="1"
|
|
|
:key="index"
|
|
:key="index"
|
|
|
@click.native="handleItem(index)"
|
|
@click.native="handleItem(index)"
|
|
@@ -74,7 +75,7 @@
|
|
|
:http-request="handleImages"
|
|
:http-request="handleImages"
|
|
|
:before-upload="handleBeforeImages"
|
|
:before-upload="handleBeforeImages"
|
|
|
:on-exceed="handleExceeds"
|
|
:on-exceed="handleExceeds"
|
|
|
- :on-remove="handleRemove"
|
|
|
|
|
|
|
+ :on-remove="handleRemoves"
|
|
|
:limit="1"
|
|
:limit="1"
|
|
|
class="upload-resource"
|
|
class="upload-resource"
|
|
|
>
|
|
>
|
|
@@ -105,6 +106,7 @@ export default {
|
|
|
remark: null,
|
|
remark: null,
|
|
|
activeItem: null,
|
|
activeItem: null,
|
|
|
itemActive: null,
|
|
itemActive: null,
|
|
|
|
|
+ activeIndex: null,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -155,8 +157,15 @@ export default {
|
|
|
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`,
|
|
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`,
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 删除图片
|
|
|
|
|
+ handleRemove() {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.data.detail[this.activeIndex].sourceList = [];
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ },
|
|
|
// 记录段落
|
|
// 记录段落
|
|
|
handleItem(index) {
|
|
handleItem(index) {
|
|
|
|
|
+ this.activeIndex = index;
|
|
|
this.activeItem = this.data.detail[index];
|
|
this.activeItem = this.data.detail[index];
|
|
|
},
|
|
},
|
|
|
// 图片上传前处理
|
|
// 图片上传前处理
|
|
@@ -184,7 +193,7 @@ export default {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
// 删除图片
|
|
// 删除图片
|
|
|
- handleRemove() {
|
|
|
|
|
|
|
+ handleRemoves() {
|
|
|
this.itemActive.img = [];
|
|
this.itemActive.img = [];
|
|
|
},
|
|
},
|
|
|
// 图片上传前处理
|
|
// 图片上传前处理
|