代码如下:
<el-col :span="6">
<el-form-item label="区域">
<el-cascader ref="areaCascader" class="row-inp" :options="areaData" :props="{ multiple: true }" collapse-tags clearable filterable @change="handleCityChange" placeholder="请选择区域" />
</el-form-item>
</el-col>
js方法
const areaCascader = ref(null)
// 获取统计区域城市名
const handleCityChange = val => {
queryForm.value.checkAraeList = val
queryForm.value.area = areaCascader.value
.getCheckedNodes()
.filter(item => !(item.parent && item.parent.checked))
.map(item => item.pathLabels.join('-'))
.toString()
}
areaCascader.value.getCheckedNodes() 获取选中节点