Element ui 表格 刪除

刪除時請求刪除的接口

<el-table-column label="操作" width="131">
      <template slot-scope="scope">
           <el-button @click="deleteRow(scope.$index,scope.row)" type="text" size="small">刪除</el-button>
      </template>
</el-table-column>
 deleteRow(index, rows) {
         this.axios.deleteType({
           id:rows.id
         }).then(res=>{
           if(res.data==1){
             this.$message({
               type:'success',
               message:'刪除成功'
             })
              this.getapp();
           }else{
              this.$message({
                type:'info',
                message:'刪除失敗'
             })
           }
           
         }).catch(res=>{

         })
        
      },
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章