ElementUi——el-select下拉框
<el-select v-model="ruleForm.status" placeholder="请选择状态" @change="styleChange">
<el-option v-for="item in optionA4" :key="item.value" :label="item.label" :value="item.value"/> </el-select>
JS:
optionA4: [
{
value: '0',
label: '全部状态'
},
{
value: '1',
label: '正常运行'
},
{
value: '2',
label: '离线或故障'
},
{
value: '3',
label: '超标报警'
}
],
改变方法:
styleChange(val) { if(val == 0){ this.isShow1 = true, this.isShow2 = false }else{ this.isShow1 = false this.isShow2 = true } var data= {} this.outfallType = val data.outfallType = this.outfallType getRealDataV2(data).then(val => { if (val.code === 200) { this.newData(val) } }) },