github.com/soypat/vectytemplater@v0.0.0-20220501050640-d40b24e35168/_templates/websocket-cli/app/views/landing.go (about)

     1  package views
     2  
     3  import (
     4  	"vecty-templater-project/model"
     5  
     6  	"github.com/hexops/vecty"
     7  	"github.com/hexops/vecty/elem"
     8  )
     9  
    10  type Landing struct {
    11  	vecty.Core
    12  	Items []model.Item `vecty:"prop"`
    13  }
    14  
    15  func (l *Landing) Render() vecty.ComponentOrHTML {
    16  	var items vecty.List
    17  	for _, item := range l.Items {
    18  		items = append(items, elem.ListItem(
    19  			vecty.Text(item.Title),
    20  		))
    21  	}
    22  	return elem.UnorderedList(items)
    23  }