其他分享
首页 > 其他分享> > element 下拉框select

element 下拉框select

作者:互联网

 

代码

<el-table-column sortable label="工作阶段" width="115">                             <template slot-scope="scope">                                 <el-select v-if="scope.row.isSelected" clearable v-model="scope.row.stageName" size="mini" >                                   <el-option v-for="item in gongzuojdarr" :key="item.index" :label="item.name" :value="item.name"                                    @click.native="getgzjieduan(scope.row,scope.$index)"/>                                 </el-select>                                 <div @click="cellClick(scope.row,scope.$index,scope.row.stageName)" v-else>                                   {{scope.row.stageName}}                                 </div>                             </template>                         </el-table-column>

下拉方法

数组内插入isSelected字段

// 工作阶段         getgzjieduan(val,index) {           alert(this.cellValue+"             "+val.stageName+"          "+JSON.stringify(val));           if(this.cellValue == val.stageName){             val.isSelected = false             this.$set(this.tabledata, index, val)             return ;           }             console.log("工作阶段修改");             console.log(val);             if (val.stageName == "启动阶段") {                 val.stage = "SS";             } else if (val.stageName == "需求阶段") {                 val.stage = "NS";             } else if (val.stageName == "设计阶段") {                 val.stage = "PS";             } else if (val.stageName == "构建阶段") {                 val.stage = "BS";             } else if (val.stageName == "测试阶段") {                 val.stage = "TS";             } else if (val.stageName == "上线运行阶段") {                 val.stage = "OS";             } else if (val.stageName == "验收阶段") {                 val.stage = "CS";             } else {                 val.stage = "OM";             }           val.isSelected = false             this.$set(this.tabledata, index, val)             console.log(val);             this.qingqiudatafun(val);         }, 点击方法 cellClick(row,index,value){         this.cellValue=value         row.isSelected = true         this.$set(this.tabledata, index, row)       },

标签:index,val,stageName,row,element,else,下拉框,select,stage
来源: https://www.cnblogs.com/Nancy9669/p/16392702.html