代码如下,表格中的el-select,看了网上说明一般都是在data中设置(比如risk_type设置为0),但我这表格中他的初始值不相同,这个该如何设置。试过将select绑定值设为scope.row.risk_type,但是 @change的选中值无法获取 <el-table-column prop="status" :formatter="showStatus" label="状态"> </el-table-column> <el-table-column prop="risk_type" label="单控操作"> <template slot-scope="scope" > <el-select v-model="controlSetting.risk_type" @change="orderEdit(scope.row.id)" v-if="scope.row.status==0" size="mini"> <el-option label="默认" value="0"></el-option> <el-option label="赢了" value="1"></el-option> <el-option label="损亏" value="2"></el-option> </el-select> <span v-if="scope.row.status!=0">已完成</span> </template> </el-table-column> data() { return { proData:[], data:[], count:0, page:1, controlSetting:{ risk_type: '', id: '' }, orderEdit:function(id){ var _this=this; _this.controlSetting.id=id; _this.axios.post(_this.global.httpUrl+"?r=order/update",_this.qs.stringify( _this.controlSetting)) .then(function (response) { if(response.data.status=="SUCCESS"){ _this.data=response.data.results; _this.$message.success('修改成功'); _this.allSearch(); }else{ _this.loginStatus(response.data.status,response.data.error_message); } }) .catch(function (error) { console.log(error); }); }
添加回答
举报
0/150
提交
取消