<template>
<el-cascader
v-model="parentId"
:options="categoryOptions"
filterable
placeholder="请选择分类"
:props="cascaderProp"
clearable
></el-cascader>
</template>
<script>
const categoryOptions = [
{
"id": "6988033358453547009",
"name": "Fiber Optic Components",
"parentId": null,
"order": 0,
"isEnabled": 1,
"cnName": "光纤元件",
"children": [
{
"id": "6988033358650679296",
"name": "Electrical to Optical Converters",
"parentId": "6988033358453547009",
"order": 0,
"isEnabled": 1,
"cnName": "电光转换器-修改后"
},
{
"id": "6988033358826840064",
"name": "Fiber Optic Adapters",
"parentId": "6988033358453547009",
"order": 0,
"isEnabled": 0,
"cnName": "光纤适配器"
}
]
}
]
const cascaderProp = {
multiple: false,
emitPath: false,
value: 'id',
label: 'cnName',
checkStrictly: true,
expandTrigger: 'hover'
}
</script>