elementUI级联选择器cascader可以选择任意一级选项收起

elCascaderOnlick() {
      let that = this;
      setTimeout(function() {
        document.querySelectorAll(".el-cascader-node__label").forEach(el => {
          el.onclick = function() {
            this.previousElementSibling.click();
            that.$refs.elcascader.dropDownVisible = false;
          };
        });
        document
          .querySelectorAll(".el-cascader-panel .el-radio")
          .forEach(el => {
            el.onclick = function() {
              that.$refs.elcascader.dropDownVisible = false;
            };
          });
      }, 100);
    },

参考了如下文章

https://blog.csdn.net/qq_36410795/article/details/100894520

你可能感兴趣的:(前端H5)