File tree 4 files changed +5
-5
lines changed
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export function saveRef (key, c) {
45
45
export function getActiveKey ( props , originalActiveKey ) {
46
46
let activeKey = originalActiveKey
47
47
const { eventKey, defaultActiveFirst, children } = props
48
- if ( activeKey ) {
48
+ if ( activeKey !== undefined && activeKey !== null ) {
49
49
let found
50
50
loopMenuItem ( children , ( c , i ) => {
51
51
const propsData = c . componentOptions . propsData || { }
@@ -205,7 +205,7 @@ const SubPopupMenu = {
205
205
206
206
getEventKey ( ) {
207
207
// when eventKey not available ,it's menu and return menu id '0-menu-'
208
- return this . eventKey || '0-menu-'
208
+ return this . eventKey !== undefined ? this . eventKey : '0-menu-'
209
209
} ,
210
210
211
211
getOpenTransitionName ( ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ export function noop () {
3
3
4
4
export function getKeyFromChildrenIndex ( child , menuEventKey , index ) {
5
5
const prefix = menuEventKey || ''
6
- return child . key || `${ prefix } item_${ index } `
6
+ return child . key === undefined ? `${ prefix } item_${ index } ` : child . key
7
7
}
8
8
9
9
export function getMenuIdFromSubMenuEventKey ( eventKey ) {
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export default {
126
126
let clonedMenuItems = menuItems
127
127
if ( selectedKeys . length || firstActiveValue ) {
128
128
if ( props . visible && ! this . lastVisible ) {
129
- activeKeyProps . activeKey = selectedKeys [ 0 ] || firstActiveValue
129
+ activeKeyProps . activeKey = selectedKeys [ 0 ] !== undefined ? selectedKeys [ 0 ] : firstActiveValue
130
130
}
131
131
let foundFirst = false
132
132
// set firstActiveItem via cloning menus
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export function getSelectKeys (menuItems, value) {
122
122
} else {
123
123
const itemValue = getValuePropValue ( item )
124
124
const itemKey = item . key
125
- if ( findIndexInValueBySingleValue ( value , itemValue ) !== - 1 && itemKey ) {
125
+ if ( findIndexInValueBySingleValue ( value , itemValue ) !== - 1 && itemKey !== undefined ) {
126
126
selectedKeys . push ( itemKey )
127
127
}
128
128
}
You can’t perform that action at this time.
0 commit comments