页面:
<el-cascader
                v-model="areaId"
                ref="refHandle"
                :options="areaList"
                :props="{ checkStrictly: true }"
                @change="handleChange"
                expand-trigger="hover"
                clearable
              ></el-cascader>
逻辑:
 watch:{
    areaId:{
      handler(newVal, oldVal) {
        if (this.$refs.refHandle) {
          var children = this.$refs.refHandle.getCheckedNodes();
          if(children[0].children.length < 1){   //判断有没有下级
            this.$refs.refHandle.dropDownVisible = false; //监听值发生变化就关闭它
          }
        }
      },
    }
  }

  判断值有没有变化,变化切没有下一级,关闭级联选择

相关文章:

  • 2021-05-12
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-07-15
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-12-08
相关资源
相似解决方案