fix(components): [el-tabs] fix tab render (#4383)

This commit is contained in:
三咲智子 2021-11-15 10:08:07 +08:00 committed by GitHub
parent 1855687416
commit 6de5aacce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -325,17 +325,13 @@ export default defineComponent({
'aria-selected': pane.active, 'aria-selected': pane.active,
ref: `tab-${tabName}`, ref: `tab-${tabName}`,
tabindex, tabindex,
onFocus: () => { onFocus: () => setFocus(),
setFocus() onBlur: () => removeFocus(),
}, onClick: (ev: MouseEvent) => {
onBlur: () => {
removeFocus()
},
onClick: (ev) => {
removeFocus() removeFocus()
props.onTabClick(pane, tabName, ev) props.onTabClick(pane, tabName, ev)
}, },
onKeydown: (ev) => { onKeydown: (ev: KeyboardEvent) => {
if ( if (
closable && closable &&
(ev.code === EVENT_CODE.delete || (ev.code === EVENT_CODE.delete ||
@ -380,7 +376,7 @@ export default defineComponent({
: '', : '',
], ],
ref: nav$, ref: nav$,
style: navStyle, style: navStyle.value,
role: 'tablist', role: 'tablist',
onKeydown: changeTab, onKeydown: changeTab,
}, },