1. 通过css隐藏

image.png

// 添加样式名称
<el-cascader popper-class="myCascader" />
// 添加全局样式  单选、多选影藏
.myCascader .el-cascader-panel .el-cascader-menu:first-child .el-scrollbar__wrap ul li label,
.myCascader .el-cascader-panel .el-cascader-menu:first-child .el-scrollbar__wrap ul li .el-checkbox {
  display: none !important;
}

2. 通过数据disabled

image.png

<el-cascader :options="options" :props="props" clearable />
// 配置disabled属性
const props = {
  multiple: true,
  checkStrictly: true,
}

const options = [
  {
    value: 'guide',
    label: 'Guide',
    disabled: true,
    children: [
      {
        value: 'disciplines',
        label: 'Disciplines',
        children: [
          {
            value: 'consistency',
            label: 'Consistency',
          },
          {
            value: 'feedback',
            label: 'Feedback',
          },
          {
            value: 'efficiency',
            label: 'Efficiency',
          },
          {
            value: 'controllability',
            label: 'Controllability',
          },
        ],
      }
   }
]

张旭超
1.4k 声望222 粉丝

精通 html+div+css jquery, vue, angularjs, angular2, angular4, ionic, ionic2