We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca36ffd commit 55bbf94Copy full SHA for 55bbf94
components/tabs/tabs.jsx
@@ -10,6 +10,7 @@ import {
10
getListeners,
11
} from '../_util/props-util';
12
import { cloneElement } from '../_util/vnode';
13
+import isValid from '../_util/isValid';
14
import { ConfigConsumerProps } from '../config-provider';
15
import TabBar from './TabBar';
16
@@ -48,10 +49,9 @@ export default {
48
49
methods: {
50
removeTab(targetKey, e) {
51
e.stopPropagation();
- if (!targetKey) {
52
- return;
+ if(isValid(targetKey)) {
53
+ this.$emit('edit', targetKey, 'remove');
54
}
- this.$emit('edit', targetKey, 'remove');
55
},
56
handleChange(activeKey) {
57
this.$emit('change', activeKey);
0 commit comments