<!-- options 用来指定数据源 -->
<!-- props 用来指定配置对象 -->
<!-- v-model选中项绑定值 -->
<el-cascader
:options="parentCateList"
:props="cascaderProps"
v-model="selectedKeys"
@change="parentCateChanged"
clearable
change-on-select
>
</el-cascader>
// 选中的父级分类的Id数组
selectedKeys: []
// 指定级联选择器的配置对象
cascaderProps: {
value: 'id',
label: 'name',
children: 'children',
expandTrigger: 'hover'
},
// 选择项发生变化触发这个函数
parentCateChanged(val) {
console.log(this.selectedKeys)
console.log(val)
}