Breadcrumb
显示当前位置的导航层级。
实时预览
正在加载预览…
参数配置
全部字段 5
BreadcrumbItems
列表项 · 3
BreadcrumbItem
BreadcrumbItem
BreadcrumbItem
BreadcrumbOptions
Go 代码
Go
// Inside a view; c is *ui.Context, t is nui.Theme.
// Keep s (example state) outside the view. See the complete example.
nui.Breadcrumb(c.Key("breadcrumb"), t, []nui.BreadcrumbItem{{ID: "home", Label: "Home", OnSelect: func() { s.Active = "Home" }}, {ID: "projects", Label: "Projects", OnSelect: func() { s.Active = "Projects" }}, {ID: "current", Label: "NuxtUI Go"}}, nui.BreadcrumbOptions{Label: "Location", MaxItems: 3})
ui.Text(c, s.Active)使用说明
点击 Home 或 Projects 查看本地导航反馈,调整 maximum 观察长路径的收纳方式。此例记录选中项;真实路由切换由应用的 OnSelect 实现。
API 参考
Breadcrumb
源码func Breadcrumb(c *ui.Context, t Theme, items []BreadcrumbItem, o BreadcrumbOptions) ui.ElementBreadcrumbOptions
源码type BreadcrumbOptions struct {
Label string
MaxItems int
Decoration
}| 字段 | 类型 | 说明 |
|---|---|---|
Label | stringGo 零值: | 控件标签或可访问名称。 |
MaxItems | intGo 零值: | 允许显示的项目数上限。 |
UI | StylesGo 零值: | 以部件名称为键覆盖外观和间距。 |
Style | func(Slot, ui.Element)Go 零值: | 同步配置当前构建的部件;不要保留 Element。 |