page.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package e16_hello_vuetify_simple_components
  2. import (
  3. . "github.com/qor5/ui/vuetify"
  4. "github.com/qor5/web"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. func HelloVuetifySimpleComponents(ctx *web.EventContext) (pr web.PageResponse, err error) {
  8. wrapper := func(children ...h.HTMLComponent) h.HTMLComponent {
  9. return VApp(
  10. VMain(
  11. VContainer(
  12. children...,
  13. ),
  14. ),
  15. ).Id("mainapp")
  16. }
  17. pr.Body = wrapper(
  18. h.Div(
  19. VAvatar(
  20. h.Img("https://vuetifyjs.com/apple-touch-icon-180x180.png"),
  21. ).Color("grey lighten-3").Size(32),
  22. VAvatar(
  23. h.Img("https://vuetifyjs.com/apple-touch-icon-180x180.png"),
  24. ).Tile(true).Color("grey lighten-3").Size(32),
  25. ).Style("margin-bottom: 40px"),
  26. h.Div(
  27. VBadge(
  28. web.Slot(
  29. h.Span("6"),
  30. ).Name("badge"),
  31. VIcon("shopping_cart").
  32. Large(true).
  33. Color("grey lighten-1"),
  34. ).Left(true),
  35. ).Style("margin-bottom: 40px"),
  36. h.Div(
  37. VChip(h.Text("Example Chip")),
  38. VChip(h.Text("Example Chip")).Close(true),
  39. VChip(
  40. VAvatar(h.Img("https://randomuser.me/api/portraits/men/35.jpg")),
  41. h.Text("Trevor Hansen"),
  42. ).Close(true),
  43. VChip(
  44. VAvatar(h.Text("A")).Class("teal"),
  45. h.Text("ANZ Bank"),
  46. ),
  47. ).Style("margin-bottom: 40px"),
  48. h.Div(
  49. VAlert(h.Text("This is a success alert.")).Type("success").Value(true),
  50. ).Style("margin-bottom: 40px"),
  51. )
  52. return
  53. }