页签标签保持单行且不参与压缩;窄容器由宿主提供横向滚动或“更多”入口,不能靠标签换行挤入。
基本用法
items 定义页签,v-model 同步当前值;省略模型时默认选中第一个可用项。item.disabled 跳过不可用页签。
方向与激活方式
orientation="vertical" 使用上下方向键。activationMode="manual" 先移动焦点,再按 Enter 或 Space 选择,适合切换成本较高的内容;默认自动激活。
受控状态与内容保留
通过 v-model 从外部切换。默认保留面板状态;lazyMount 延迟首次挂载,unmountOnExit 离开时销毁面板,未保存的内部状态也会丢失。
面板留白
contentPadding="none" 用于已自行管理留白的内容。默认保留面板留白,预览容器的外部留白单独管理。
组合示例
横向自动激活与纵向手动激活可用于不同工作区域。size 与同排控件共用五档,loopFocus 决定首尾是否循环。
外置面板
renderPanels=false 时,为每项提供指向真实内容区的 panelId。调用方负责可见性、tabpanel 语义及标签关联;一般使用默认内部面板即可。
API
QuireTabs Props
Slots 内容位置
trigger替换页签的可见标签。
{ /** 当前页签合同。 */ item: { /** 页签、面板关联和 v-model 使用的稳定值。 */ value: string; /** Existing panel id when the owning application places panels outside Tabs. */ panelId?: undefined | string; /** 页签的可见名称。 */ label: string; /** 未提供 content 插槽时显示的面板文本。 */ content?: string | undefined; /** 是否禁止聚焦和选择当前页签。 */ disabled?: boolean | undefined; }; /** 当前页签是否已选中。 */ selected: boolean; }content替换每个页签面板内容。
{ /** 当前页签合同。 */ item: { /** 页签、面板关联和 v-model 使用的稳定值。 */ value: string; /** Existing panel id when the owning application places panels outside Tabs. */ panelId?: undefined | string; /** 页签的可见名称。 */ label: string; /** 未提供 content 插槽时显示的面板文本。 */ content?: string | undefined; /** 是否禁止聚焦和选择当前页签。 */ disabled?: boolean | undefined; }; /** 当前面板是否处于选中状态。 */ selected: boolean; }
Events 组件事件
update:modelValue更新
modelValue,可通过对应 v-model 绑定。[value: string | undefined]