<el-cascader
          :options="treeChildren"
          v-model="classiId"
          :props="setKesLabel"
          :show-all-levels="false"
          clearable
></el-cascader>

其中options为请求后台返回的树结构,props是为了解决后台返回数据格式不统一的问题,比如上下级用childlist来连接而不是用children来连接,这时候使用props来自己规范格式即可

1  setKesLabel:{
2      checkStrictly: true,
3      value:'id',
4      label:'name',
5      children:'children'
6   },

show-all-levels用来控制在输入框是否显示完整路径,这个在element官网里也有介绍。值得注意的是,v-model绑定的数据返回的是路径上的所有id组成的数据list。