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()
            }
                  
  • 相关阅读:
    20180209-json&pickle&shelve模块
    20180209-shutil模块
    20180209-sys模块
    20180209-os模块
    20180115-Xcode创建多个工程协同开发
    20180108-递归函数
    20180105-Python中dict的使用方法
    Python-编码这趟浑水
    20171218-编程语言的介绍
    20180119-01-RACSignal的基础
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/13182588.html
Copyright © 2011-2022 走看看