关于element-ui el-cascader 级联选择器 单独选择任意一级选项,去掉单选按钮(记录一下)

效果如下:

分类

在这里插入图片描述
代码如下: 单独选择任意一项属性 checkStrictly , 绑定的是分类 id popper-class自定义类名

             <el-cascader
              v-model="form.cateIds"
              :options="cateList"
               popper-class="removeRadio"
              :props="{ checkStrictly: true,value:'id' }"
              clearable></el-cascader>

修改样式:不能加 scope 也可以放在全局样式上,要修改的样式前面要加上自定义的样式名。

<style>

.removeRadio .el-radio__inner {
    
    
  border-radius: 0;
  border: 0;
  width: 170px;
  height: 34px;
  background-color: transparent;
  cursor: pointer;
  box-sizing: border-box;
  position: absolute;
  top: -18px;
  left: -19px;
}

.removeRadio .el-radio__input.is-checked .el-radio__inner {
    
    
  background: transparent;
}

</style>

猜你喜欢

转载自blog.csdn.net/weixin_45753588/article/details/129852977