elementUI vue table 操作选项中弹出框确定dialog
程序员文章站
2022-03-20 15:09:20
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(); } }) } },