package navigation import ( "log" "github.com/vugu/vgrouter" "github.com/vugu/vugu" ) type SidebarEntry struct { vgrouter.NavigatorRef PageInfoRef AttrMap vugu.AttrMap classes string // TODO: Use AttrMap to handle classes or something else SymbolSlot vugu.Builder // Slot for the symbol. DefaultSlot vugu.Builder // Slot for the text and other stuff. Should be a div element! URL string } func (c *SidebarEntry) handleClick(event vugu.DOMEvent) { c.Navigate(c.URL, nil) } func (c *SidebarEntry) Compute(ctx vugu.ComputeCtx) { log.Printf("%v", c.PageInfo) if c.PageInfo != nil && c.PageInfo.Path == c.URL { c.classes = "d3c-1683622560-selected" } else { c.classes = "" } }