el-cascader如何控制只能选择末级?

 <el-cascader

              v-model="listType"

              :options="listTypeArr"

              :props="dialogProps"

              clearable

              size="mini"

              style="width: 220px"

              @change="changelistType"

            ></el-cascader>

dialogProps: {

        expandTrigger: "hover",

        checkStrictly: true,

        value: "id",

        label: "categoryName",

        children: "children",

        emitPath: false,

      },

您的问题已经有小伙伴解答了,请点击【采纳】按钮,采纳帮您提供解决思路的答案,给回答的人一些鼓励哦~~

ps:开通问答VIP,享受5次/月 有问必答服务,了解详情↓↓↓

【电脑端】戳>>>  https://vip.csdn.net/askvip?utm_source=1146287632
【APP 】  戳>>>  https://mall.csdn.net/item/52471?utm_source=1146287632


 <el-cascader
              v-model="listType"
              :options="listTypeArr"
              :props="dialogProps"
              clearable
              size="mini"
              style="width: 220px"
              @change="changelistType"
            ></el-cascader>
dialogProps: {
        expandTrigger: "hover",
        value: "id",
        label: "categoryName",
        children: "children",
        emitPath: false,
      },
1、把:checkStrictly=true去掉
2、当该节点没有子节点时,数据结构中就不要children就可以了

https://element.eleme.cn/#/zh-CN/component/cascader#jin-xian-shi-zui-hou-yi-ji  这个不行吗

将el-cascader的show-all-levels属性设置为false   :show-all-levels="false"