Breadcrumb

显示当前位置的导航层级。

实时预览

正在加载预览…

参数配置

全部字段 5

BreadcrumbItems

列表项 · 3
BreadcrumbItem
BreadcrumbItem
BreadcrumbItem

BreadcrumbOptions

Styles · 0

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.Element

BreadcrumbOptions

源码
type BreadcrumbOptions struct {
	Label    string
	MaxItems int
	Decoration
}
字段类型说明
Labelstring

Go 零值: ""

控件标签或可访问名称。

MaxItemsint

Go 零值: 0

允许显示的项目数上限。

UIStyles

Go 零值: zero value

以部件名称为键覆盖外观和间距。

Stylefunc(Slot, ui.Element)

Go 零值: nil

同步配置当前构建的部件;不要保留 Element。