Skip to content

HeaderTabs 头部页签

xy-header-tabs 用来承接多页签后台壳子的顶部标签切换和批量关闭动作。

基础用法

适合在管理后台壳子里统一承接标签页切换。

HeaderTabs API

HeaderTabs Attributes

属性说明类型默认值
model-value当前激活页签 key,受控模式stringundefined
default-value默认激活页签 key,非受控模式stringundefined
items页签数据,HeaderTabItem 继承自 TabItem 并扩展 badge?: string | numberHeaderTabItem[][]
type页签风格TabsType'' | 'card' | 'border-card''card'
tab-position页签位置TabsPosition'top' | 'right' | 'bottom' | 'left''top'
closable是否显示页签关闭按钮booleantrue
addable是否允许新增页签booleanfalse
editable是否编辑模式(同时开启新增和关闭)booleanfalse
before-leave切换页签前的拦截钩子TabsBeforeLeaveundefined
menu-actions右侧批量操作菜单项Array<{ key: HeaderTabsMenuAction; label: string }>内置五个关闭动作:关闭当前、关闭其他、关闭左侧、关闭右侧、关闭全部

HeaderTabs Events

事件名说明参数
update:modelValue激活页签变化时派发(value: string) => void
change激活页签变化时派发(value: string) => void
edit页签新增或关闭时派发(key: string | undefined, action: 'remove' | 'add') => void
tabRemove关闭页签时派发(key: string) => void
tabAdd点击新增页签时派发() => void
tabMenuClick点击右侧菜单动作时派发(action: HeaderTabsMenuAction) => voidHeaderTabsMenuAction'close-current' | 'close-others' | 'close-left' | 'close-right' | 'close-all'