Skip to content

Commit

Permalink
fix(components): [tabs] name is number 0 become a string
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxch committed Jun 28, 2022
1 parent f3a364c commit a6205bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/tabs/src/tabs.tsx
Expand Up @@ -70,7 +70,7 @@ export const tabsEmits = {
'tab-change': (name: TabPanelName) => isPanelName(name),
edit: (paneName: TabPanelName | undefined, action: 'remove' | 'add') =>
['remove', 'add'].includes(action),
'tab-remove': (name?: TabPanelName) => isPanelName(name),
'tab-remove': (name: TabPanelName) => isPanelName(name),
'tab-add': () => true,
}
export type TabsEmits = typeof tabsEmits
Expand Down Expand Up @@ -124,7 +124,7 @@ export default defineComponent({
}

const handleTabRemove = (pane: TabsPaneContext, ev: Event) => {
if (pane.props.disabled) return
if (pane.props.disabled || isUndefined(pane.props.name)) return
ev.stopPropagation()
emit('edit', pane.props.name, 'remove')
emit('tab-remove', pane.props.name)
Expand Down

0 comments on commit a6205bb

Please sign in to comment.