<!-- 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)
}
版权声明:本文为weixin_46852620原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。