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