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) {
console.log(value)
console.log(this.$refs["refSubCat"].getCheckedNodes()[0].label)
},