pull/2284/head
tangjinzhou 2020-05-17 22:41:38 +08:00
commit 1a595d5568
1 changed files with 3 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import {
getListeners, getListeners,
} from '../_util/props-util'; } from '../_util/props-util';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';
import isValid from '../_util/isValid';
import { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumerProps } from '../config-provider';
import TabBar from './TabBar'; import TabBar from './TabBar';
@ -48,10 +49,9 @@ export default {
methods: { methods: {
removeTab(targetKey, e) { removeTab(targetKey, e) {
e.stopPropagation(); e.stopPropagation();
if (!targetKey) { if(isValid(targetKey)) {
return;
}
this.$emit('edit', targetKey, 'remove'); this.$emit('edit', targetKey, 'remove');
}
}, },
handleChange(activeKey) { handleChange(activeKey) {
this.$emit('change', activeKey); this.$emit('change', activeKey);