|
|
|
@ -9,6 +9,7 @@ import { hasProp, getEvents } from '../_util/props-util';
|
|
|
|
|
import BaseMixin from '../_util/BaseMixin'; |
|
|
|
|
import { cloneElement } from '../_util/vnode'; |
|
|
|
|
import { defineComponent } from 'vue'; |
|
|
|
|
import isEqual from 'lodash-es/isEqual'; |
|
|
|
|
|
|
|
|
|
const BUILT_IN_PLACEMENTS = { |
|
|
|
|
bottomLeft: { |
|
|
|
@ -134,7 +135,7 @@ export default defineComponent({
|
|
|
|
|
const { options = [], sActiveValue = [] } = this; |
|
|
|
|
const result = arrayTreeFilter( |
|
|
|
|
options, |
|
|
|
|
(o, level) => o[this.getFieldName('value')] === sActiveValue[level], |
|
|
|
|
(o, level) => isEqual(o[this.getFieldName('value')], sActiveValue[level]), |
|
|
|
|
{ childrenKeyName: this.getFieldName('children') }, |
|
|
|
|
); |
|
|
|
|
if (result[result.length - 2]) { |
|
|
|
@ -145,7 +146,7 @@ export default defineComponent({
|
|
|
|
|
getActiveOptions(activeValue) { |
|
|
|
|
return arrayTreeFilter( |
|
|
|
|
this.options || [], |
|
|
|
|
(o, level) => o[this.getFieldName('value')] === activeValue[level], |
|
|
|
|
(o, level) => isEqual(o[this.getFieldName('value')], activeValue[level]), |
|
|
|
|
{ childrenKeyName: this.getFieldName('children') }, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
@ -244,7 +245,7 @@ export default defineComponent({
|
|
|
|
|
const currentOptions = this.getCurrentLevelOptions(); |
|
|
|
|
const currentIndex = currentOptions |
|
|
|
|
.map(o => o[this.getFieldName('value')]) |
|
|
|
|
.indexOf(activeValue[currentLevel]); |
|
|
|
|
.findIndex(val => isEqual(activeValue[currentLevel], val)); |
|
|
|
|
if ( |
|
|
|
|
e.keyCode !== KeyCode.DOWN && |
|
|
|
|
e.keyCode !== KeyCode.UP && |
|
|
|
|