value 好获取,主要是label,我百度了半天都是说用 this.$refs[关联组件名].currentLabels
可以获取,但是这个方法已经过期了。
还是自己看文档才发现使用 getCheckedNodes
方法的节点获取。完整的 this.$refs["refSubCat"].getCheckedNodes()[0].label
1. 效果
2. 代码
<el-cascader
ref="refSubCat"
:show-all-levels="false"
:options="allSubCatList"
:props="subCatProps"
@change="handleSubCat"
v-model="subCatValue"
></el-cascader>
handleSubCat(value) {
// 获取value值
console.log(value)
// 获取label 值
console.log(this.$refs["refSubCat"].getCheckedNodes()[0].label)
},