ElementUI 的 Cascader 级联选择器对 :options=“options” 里的数据格式是有特定要求的:input 框显示的值是 options 里的 label 值。如果 options 的键值对不是 value label ,就需要 props 来配置。
<el-cascader
ref="cascader"
v-model="companyForm.industry"
style="width: 500px; "
:options="belongIndustry"
:props="{ multiple: true, emitPath:false }"
:clearable="true"
@change="nodeValue"
/>
export default {
data() {
belongIndustry:[
{ id: 1, name: '第一层', children: [ id: 11, name: '水果']},
{ id: 2, name: '第二层', children: [ id: 22, name: '蔬菜'] },
]
}
}