rjy vor 4 Jahren
Ursprung
Commit
8d9d664218
1 geänderte Dateien mit 13 neuen und 10 gelöschten Zeilen
  1. 13 10
      src/views/index.vue

+ 13 - 10
src/views/index.vue

@@ -28,7 +28,7 @@
             </template>
           </el-table-column>
           <el-table-column label="操作" class="page">
-            <el-button type="text" icon="el-icon-delete" @delete="delDelete"></el-button>
+            <el-button type="text" icon="el-icon-delete" @delete="delDelete(index)"></el-button>
           </el-table-column>
         </el-table>
         <el-pagination background layout="prev, pager, next" :total="100"> </el-pagination>
@@ -284,16 +284,19 @@ export default {
         }
       }
     },
-    async delDelete({ data }) {
-      let res = await this.delete(data.id);
-      if (this.$checkRes(res)) {
-        this.$message({
-          message: '信息删除成功',
-          type: 'success',
-        });
-        this.search();
-      }
+    async delDelete(index) {
+      this.list.splice(index, 1);
     },
+    // async delDelete({ data }) {
+    //   let res = await this.delete(data.id);
+    //   if (this.$checkRes(res)) {
+    //     this.$message({
+    //       message: '信息删除成功',
+    //       type: 'success',
+    //     });
+    //     this.search();
+    //   }
+    // },
     async searchtype() {
       // 所属领域;
       let res = await this.markettypeList({ category: '01' });