page.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package e13_vuetify_list
  2. // @snippet_begin(VuetifyListSample)
  3. import (
  4. . "github.com/qor5/ui/vuetify"
  5. "github.com/qor5/web"
  6. h "github.com/theplant/htmlgo"
  7. )
  8. func HelloVuetifyList(ctx *web.EventContext) (pr web.PageResponse, err error) {
  9. wrapper := func(children ...h.HTMLComponent) h.HTMLComponent {
  10. return VContainer(
  11. VLayout(
  12. VFlex(
  13. VCard(children...),
  14. ).Col(Xs, 6).Offset(Sm, 3),
  15. ).Row(true),
  16. ).GridList(Md).TextAlign(Xs, Center)
  17. }
  18. pr.Body = wrapper(
  19. VToolbar(
  20. // VToolbarSideIcon(),
  21. VToolbarTitle("Inbox"),
  22. VSpacer(),
  23. VBtn("").Icon(true).Children(
  24. VIcon("search"),
  25. ),
  26. ).Color("cyan").Dark(true),
  27. VList(
  28. VSubheader(h.Text("Today")),
  29. VListItem(
  30. VListItemAvatar(
  31. h.Img("https://cdn.vuetifyjs.com/images/lists/1.jpg"),
  32. ),
  33. VListItemContent(
  34. VListItemTitle(h.Text("Brunch this weekend?")),
  35. VListItemSubtitle(
  36. h.Span("Ali Connors").Class("text--primary"),
  37. h.Text("— I'll be in your neighborhood doing errands this weekend. Do you want to hang out?"),
  38. ),
  39. ),
  40. ),
  41. VDivider().Inset(true),
  42. VListItem(
  43. VListItemAvatar(
  44. h.Img("https://cdn.vuetifyjs.com/images/lists/2.jpg"),
  45. ),
  46. VListItemContent(
  47. VListItemTitle(h.RawHTML(`Summer BBQ <span class="grey--text text--lighten-1">4</span>`)),
  48. VListItemSubtitle(h.RawHTML(`<span class='text--primary'>to Alex, Scott, Jennifer</span> &mdash; Wish I could come, but I'm out of town this weekend.`)),
  49. ),
  50. ),
  51. VDivider().Inset(true),
  52. VListItem(
  53. VListItemAvatar(
  54. h.Img("https://cdn.vuetifyjs.com/images/lists/3.jpg"),
  55. ),
  56. VListItemContent(
  57. VListItemTitle(h.Text(`Oui oui`)),
  58. VListItemSubtitle(h.RawHTML(`<span class='text--primary'>Sandra Adams</span> &mdash; Do you have Paris recommendations? Have you ever been?`)),
  59. ),
  60. ),
  61. ).TwoLine(true),
  62. )
  63. return
  64. }
  65. var HelloVuetifyListPB = web.Page(HelloVuetifyList)
  66. const HelloVuetifyListPath = "/samples/hello-vuetify-list"
  67. // @snippet_end