基本用法
items 按根到当前页排列,每项提供稳定 key 和可读 label。最后一项标记为当前页;有 href 时是链接,没有时为静态文字。
禁用与空路径
disabled 保留文字,移除链接与 Tab 停靠;空数组不显示导航。ariaLabel 为同页不同路径提供可区分的名称。
内容与分隔符
item、leading、trailing 自定义静态内容,separator 替换分隔符。插槽接收原始 index 和 current;不要在链接内嵌套另一个按钮或链接。
折叠层级
maxItems 限制可见项数量(含折叠入口,最小 3),保留根与末端层级。默认完整展示并换行;展开入口的名称跟随 Locale Provider 的语言。Escape 关闭并返回入口,路径更新会关闭旧列表。
接入路由
navigate(item, event) 通知链接点击。接入客户端路由时,仅拦截普通同窗口点击,保留修饰键和新标签页行为;更新内容后由页面安排目的区域焦点。此示例模拟切换并支持恢复。
长路径与阅读方向
长名称可以换行;方向跟随语言环境。普通链接使用 Tab 和 Enter,不采用菜单式方向键导航。折叠列表仍可访问完整路径。
API
QuireBreadcrumb Props
Slots 内容位置
itemStatic item content; does not replace native link semantics.
{ /** Original location from the supplied hierarchy. */ item: { /** Stable, unique identity; labels and URLs may change independently. */ key: string; /** Readable location name, including when its icon is customized. */ label: string; /** Actual browser destination; omitted values render static text. */ href?: undefined | string; /** Native browsing context, such as _blank. */ target?: string | undefined; /** Native link relationship; new-window links default to noopener noreferrer. */ rel?: string | undefined; /** Keeps this location readable while removing navigation and tab focus. */ disabled?: boolean | undefined; }; /** Index in the original, uncollapsed path. */ index: number; /** Whether this is the final location. */ current: boolean; }leadingStatic icon or context preceding the label.
{ /** Original location from the supplied hierarchy. */ item: { /** Stable, unique identity; labels and URLs may change independently. */ key: string; /** Readable location name, including when its icon is customized. */ label: string; /** Actual browser destination; omitted values render static text. */ href?: undefined | string; /** Native browsing context, such as _blank. */ target?: string | undefined; /** Native link relationship; new-window links default to noopener noreferrer. */ rel?: string | undefined; /** Keeps this location readable while removing navigation and tab focus. */ disabled?: boolean | undefined; }; /** Index in the original, uncollapsed path. */ index: number; /** Whether this is the final location. */ current: boolean; }trailingStatic metadata following the label.
{ /** Original location from the supplied hierarchy. */ item: { /** Stable, unique identity; labels and URLs may change independently. */ key: string; /** Readable location name, including when its icon is customized. */ label: string; /** Actual browser destination; omitted values render static text. */ href?: undefined | string; /** Native browsing context, such as _blank. */ target?: string | undefined; /** Native link relationship; new-window links default to noopener noreferrer. */ rel?: string | undefined; /** Keeps this location readable while removing navigation and tab focus. */ disabled?: boolean | undefined; }; /** Index in the original, uncollapsed path. */ index: number; /** Whether this is the final location. */ current: boolean; }separatorDecorative separator; hidden from assistive technology.
any
Events 组件事件
navigate[item: QuireKitBreadcrumbItem, event: MouseEvent]