File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change
1
+ const isValid = value => {
2
+ return value !== undefined && value !== null && value !== '' ;
3
+ } ;
4
+ export default isValid ;
Original file line number Diff line number Diff line change @@ -72,11 +72,11 @@ const TabBar = {
72
72
73
73
if ( renderTabBar ) {
74
74
RenderTabBar = renderTabBar ( renderProps , ScrollableInkTabBar ) ;
75
+ // https://github.com/vueComponent/ant-design-vue/issues/2157
76
+ return cloneElement ( RenderTabBar , renderProps ) ;
75
77
} else {
76
- RenderTabBar = < ScrollableInkTabBar { ...renderProps } /> ;
78
+ return < ScrollableInkTabBar { ...renderProps } /> ;
77
79
}
78
- // https://github.com/vueComponent/ant-design-vue/issues/2157
79
- return cloneElement ( RenderTabBar , renderProps ) ;
80
80
} ,
81
81
} ;
82
82
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ import KeyCode from './KeyCode';
6
6
import { getOptionProps , getListeners } from '../../_util/props-util' ;
7
7
import { cloneElement } from '../../_util/vnode' ;
8
8
import Sentinel from './Sentinel' ;
9
+ import isValid from '../../_util/isValid' ;
9
10
10
11
function getDefaultActiveKey ( props ) {
11
12
let activeKey ;
12
13
const children = props . children ;
13
14
children . forEach ( child => {
14
- if ( child && ! activeKey && ! child . disabled ) {
15
+ if ( child && ! isValid ( activeKey ) && ! child . disabled ) {
15
16
activeKey = child . key ;
16
17
}
17
18
} ) ;
You can’t perform that action at this time.
0 commit comments