zoukankan      html  css  js  c++  java
  • 删除 操作

     <el-button type="danger" size="mini" icon="el-icon-delete" @click="removeById(scope.row.goods_id)"></el-button>
     
     // 删除
            async removeById(goods_id){
                  const confirmResult = await this.$confirm('此操作将永久删除该商品, 是否继续?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                   }).catch(err => err) 
                // 取消删除操作
                if(confirmResult !== 'confirm'){
                    return this.$message.info('已取消删除')
                }
                //删除 
                const {data:res} = await this.$http.delete(`categories/${goods_id}`)
                if(res.meta.status !== 200){
                    return this.$message.error('删除失败')
                }
                this.$message.success('删除成功')
                this.getGoodsList()
            }
                  
  • 相关阅读:
    数组与方法
    数据类型
    认识Java(2)
    认识Java(1)
    面试题集锦
    00-python语言介绍
    06-python-生成器、循环器
    00-python-内置函数笔记
    04-python-闭包
    03-python-装饰器
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/13182588.html
Copyright © 2011-2022 走看看