Skip to content

Commit 7082d6f

Browse files
committed
fix: Cascader item key type error #219
1 parent 0db7b0a commit 7082d6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/vc-cascader/Menus.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import arrayTreeFilter from 'array-tree-filter'
44
import BaseMixin from '../_util/BaseMixin'
55

66
export default {
7+
name: 'CascaderMenus',
78
mixins: [BaseMixin],
89
props: {
910
value: PropTypes.array.def([]),
@@ -46,13 +47,14 @@ export default {
4647
const onSelect = (e) => {
4748
this.__emit('select', option, menuIndex, e)
4849
}
50+
const key = option[this.getFieldName('value')]
4951
const expandProps = {
5052
attrs: {
5153
},
5254
on: {
5355
click: onSelect,
5456
},
55-
key: option[this.getFieldName('value')],
57+
key: Array.isArray(key) ? key.join('__ant__') : key,
5658
}
5759
let menuItemCls = `${prefixCls}-menu-item`
5860
const hasChildren = option[this.getFieldName('children')] &&

0 commit comments

Comments
 (0)