fix: defaultActiveFirstOption is true and activeKey is Falsy will ret… (#1979)

* fix: defaultActiveFirstOption is true and activeKey is Falsy will return the next child key #1727

* fix: defaultActiveFirstOption is true and activeKey is undefined #1727
This commit is contained in:
Jy 2020-04-04 15:07:59 +08:00 committed by GitHub
parent 082dc2ade0
commit 94b701c077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,8 @@ export function getActiveKey(props, originalActiveKey) {
if (defaultActiveFirst) {
loopMenuItem(children, (c, i) => {
const propsData = c.componentOptions.propsData || {};
if (!activeKey && c && !propsData.disabled) {
const noActiveKey = activeKey === null || activeKey === undefined;
if (noActiveKey && c && !propsData.disabled) {
activeKey = getKeyFromChildrenIndex(c, eventKey, i);
}
});