tianyunperfect 1 年之前
父節點
當前提交
8fff3ea261
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      simple-demo/send_memos.html

+ 8 - 0
simple-demo/send_memos.html

@@ -175,6 +175,7 @@
                               :preview-src-list="['https://memos_assert.tianyunperfect.cn/' + img['internal_path']]"
                               style="max-height: 200px;max-width: 300px; margin: 10px 10px 0 0; cursor: pointer">
                     </el-image>
+                    <div @click="delPic(img)">删除</div>
                 </div>
 
             </div>
@@ -242,6 +243,13 @@
             this.search();
         },
         methods: {
+            delPic(img){
+              // 根据id从  cloneFileIds 删除
+                let index = this.cloneFileIds.findIndex(item => item.id === img.id);
+                if (index !== -1) {
+                    this.cloneFileIds.splice(index, 1);
+                }
+            },
             getCloneResourceIds(id) {
                 let resourceMapElement = this.resourceMap[id];
                 if (resourceMapElement) {