a-taste-of-using-vuetify-in-go.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package advanced_functions
  2. import (
  3. "github.com/qor5/docs/docsrc/examples/e13_vuetify_list"
  4. "github.com/qor5/docs/docsrc/examples/e14_vuetify_menu"
  5. "github.com/qor5/docs/docsrc/generated"
  6. "github.com/qor5/docs/docsrc/utils"
  7. . "github.com/theplant/docgo"
  8. "github.com/theplant/docgo/ch"
  9. . "github.com/theplant/htmlgo"
  10. )
  11. var ATasteOfUsingVuetifyInGo = Doc(
  12. Markdown(`
  13. [Vuetify](https://vuetifyjs.com/en/) is a really mature Vue components library for
  14. [Material Design](https://material.io/design/). We have made the efforts to
  15. integrate most all of it as a go package. You can use it with ease just like any
  16. other go package.
  17. `),
  18. utils.Anchor(H2(""), "Use container, toolbar, list, list item etc"),
  19. Markdown(`
  20. This example is purely render, we didn't integrate any interaction (event func) to it.
  21. `),
  22. ch.Code(generated.VuetifyListSample).Language("go"),
  23. utils.Demo("Vuetify List", e13_vuetify_list.HelloVuetifyListPath, "e13_vuetify_list/page.go"),
  24. utils.Anchor(H2(""), "Use menu, card, list, etc"),
  25. Markdown(`
  26. This example uses the menu popup, card, list component. and some interactions of clicking
  27. buttons on the menu popup.
  28. `),
  29. ch.Code(generated.VuetifyMenuSample).Language("go"),
  30. Markdown(`
  31. ~.Attr(web.InitContextVars, "{myMenuShow: false}")~ is a special vue directive that
  32. we created to initialize vue context component data variables. It will initialize
  33. ~vars.myMenuShow~ to ~false~. So that you don't need to modify javascript code to do
  34. the initialization. It's often useful to control dialog, popups. At this example,
  35. We add it, So that the cancel button on the menu, could actually close the menu without
  36. requesting server backend.
  37. ~toggleFavored~ event func did an partial update only to the favorite icon button. So that it won't close the
  38. menu popup, but updated the button to toggle the favorite icon.
  39. `),
  40. utils.Demo("Vuetify Menu", e14_vuetify_menu.HelloVuetifyMenuPath, "e14_vuetify_menu/page.go"),
  41. ).Title("A Taste of using Vuetify in Go").
  42. Slug("vuetify-components/a-taste-of-using-vuetify-in-go")