fix: removeTab support 0 as key

fix: removeTab support 0 as key
pull/2284/head
super918180 2020-05-17 11:25:36 +08:00 committed by GitHub
parent ca36ffdb42
commit 55bbf94040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

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