rjy 4 年之前
父节点
当前提交
8d9d664218
共有 1 个文件被更改,包括 13 次插入10 次删除
  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' });