FooterColumns
按栏目组织页脚导航。
实时预览
正在加载预览…
参数配置
全部字段 5
FooterColumnsItems
列表项 · 2
FooterColumn
FooterColumn
列表项 · 2
NavigationItem
列表项 · 0
NavigationItem
列表项 · 0
FooterColumnsOptions
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.FooterColumns(c.Key("footer"), t, []nui.FooterColumn{{ID: "product", Title: "Product", Items: []nui.NavigationItem{{ID: "components", Label: "Components"}, {ID: "examples", Label: "Examples"}}}, {ID: "resources", Title: "Resources", Items: []nui.NavigationItem{{ID: "guide", Label: "Guide"}, {ID: "source", Label: "Source"}}}}, nui.FooterColumnsOptions{MinColumnWidth: float32(160), OnNavigate: func(id string) { s.Active = id }})
ui.Text(c, s.Active)使用说明
点击页脚链接查看 OnNavigate 返回的项目 ID,缩窄窗口或调整最小列宽比较排列。栏目与链接均使用稳定 ID,真实跳转由应用处理。
API 参考
FooterColumns
源码func FooterColumns(c *ui.Context, t Theme, columns []FooterColumn, o FooterColumnsOptions) ui.ElementFooterColumnsOptions
源码type FooterColumnsOptions struct {
MinColumnWidth float32
OnNavigate func(string)
Decoration
}| 字段 | 类型 | 说明 |
|---|---|---|
MinColumnWidth | float32Go 零值: | 导航栏目最小宽度。 |
OnNavigate | func(string)Go 零值: | 激活导航项目时通知应用的回调。 |
UI | StylesGo 零值: | 以部件名称为键覆盖外观和间距。 |
Style | func(Slot, ui.Element)Go 零值: | 同步配置当前构建的部件;不要保留 Element。 |