Skip to content

Commit 55bbf94

Browse files
authored
fix: removeTab support 0 as key
fix: removeTab support 0 as key
1 parent ca36ffd commit 55bbf94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: components/tabs/tabs.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
getListeners,
1111
} from '../_util/props-util';
1212
import { cloneElement } from '../_util/vnode';
13+
import isValid from '../_util/isValid';
1314
import { ConfigConsumerProps } from '../config-provider';
1415
import TabBar from './TabBar';
1516

@@ -48,10 +49,9 @@ export default {
4849
methods: {
4950
removeTab(targetKey, e) {
5051
e.stopPropagation();
51-
if (!targetKey) {
52-
return;
52+
if(isValid(targetKey)) {
53+
this.$emit('edit', targetKey, 'remove');
5354
}
54-
this.$emit('edit', targetKey, 'remove');
5555
},
5656
handleChange(activeKey) {
5757
this.$emit('change', activeKey);

0 commit comments

Comments
 (0)