File tree Expand file tree Collapse file tree
src/components/base/upload-imgs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 :fit =" fit"
4949 style =" width : 100% ; height : 100% ;" ></el-image >
5050 <div class =" control" >
51- <i class =" el-icon-close del" @click.prevent.stop =" close(index )" title =" 删除" ></i >
51+ <i class =" el-icon-close del" @click.prevent.stop =" delItem(item.id )" title =" 删除" ></i >
5252 <div class =" preview" title =" 更换图片" @click.prevent.stop =" handleClick(item.id)" >
5353 <i class =" el-icon-edit" ></i >
5454 </div >
@@ -387,6 +387,12 @@ export default {
387387 // 初始化 Draggable
388388 },
389389 methods: {
390+ delItem (id ) {
391+ const { itemList } = this
392+ // 根据id找到对应项
393+ const index = itemList .findIndex (item => (item .id === id))
394+ itemList .splice (index, 1 )
395+ },
390396 previewImg (data ) {
391397 this .$confirm (` <img src="${ data .display } " style="width: 100%; height: 100%" />` , ' 预览' , {
392398 dangerouslyUseHTMLString: true ,
You can’t perform that action at this time.
0 commit comments