欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

elementUI vue table 操作选项中弹出框确定dialog

程序员文章站 2022-06-16 22:19:11
elementUI vue table 操作选项中弹出框确定dialog ......

1.html

<el-table-column label="操作" width="150" fixed="right" align="center">
    <template scope="scope">
       <el-button type="text" size="mini" @click="blockup(scope.row)" v-if="scope.row.status=1">停用</el-button>
       <el-button type="text" size="mini" @click="startusing(scope.row)" v-if="scope.row.status=0">启用</el-button>
    </template>
</el-table-column>

2.data里面

data: function () {
    return{
        startusingdialog:false,
        startusingloading:false,
        rowdata:'',
    }
},

3.方法

methods: {
    startusing(row){
      this.startusingdialog=true;
      rowdata=row;
    },
    startusingsubmit(){
        this.startusingloading=true;
        var that=this;
        var formdata={};
        $.get('url',formdata,function(data){
            if(data.code==200){
                that.startusingloading=false;
                that.startusingdialog=false;
                that.$message({
                    type:'success',
                    message:'启动成功!'
                })
                //重新刷新表格:
                //that.querydata();
            }
        })
    }
},