Judge the display and hiding of another check box according to the content of the check box

Judge the display and hiding of another check box according to the content of the check box

<el-select v-model="value" placeholder="请选择" size="mini" @change="isShowDateChange">
                      <el-option
                        v-for="item in selectOptions"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
selectOptions: [//data中的数据
        {
    
    
          value: "1",
          label: "按年统计",
        },
        {
    
    
          value: "2",
          label: "按月统计",
        },
      ],
isShowDate: true,
//切换选项 显示显示复选框
    isShowDateChange(selectValue) {
    
    
      console.log(selectValue,'selectValue');
      if (selectValue == 2) {
    
    
        this.isShowDate = true;
      } else {
    
    
        this.isShowDate = false;
      }
    },

Guess you like

Origin blog.csdn.net/weixin_43493113/article/details/113128563