<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) } }) },
