container-fix.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package vuetify
  2. import "fmt"
  3. type DType string
  4. const (
  5. DTypeFlex DType = "flex"
  6. DTypeInlineFlex DType = "inline-flex"
  7. DTypeBlock DType = "block"
  8. )
  9. type SizeType string
  10. const (
  11. Xs SizeType = "xs"
  12. Sm SizeType = "sm"
  13. Md SizeType = "md"
  14. Lg SizeType = "lg"
  15. Xl SizeType = "xl"
  16. )
  17. type AlignType string
  18. const (
  19. Left AlignType = "left"
  20. Center AlignType = "center"
  21. Right AlignType = "right"
  22. Justify AlignType = "justify"
  23. )
  24. func (b *VContainerBuilder) DType(v DType) (r *VContainerBuilder) {
  25. b.tag.Attr(fmt.Sprintf(":d-%s", v), fmt.Sprint(true))
  26. return b
  27. }
  28. func (b *VContainerBuilder) TextAlign(s SizeType, a AlignType) (r *VContainerBuilder) {
  29. b.tag.Attr(fmt.Sprintf(":text-%s-%s", s, a), fmt.Sprint(true))
  30. return b
  31. }
  32. func (b *VLayoutBuilder) DType(v DType) (r *VLayoutBuilder) {
  33. b.tag.Attr(fmt.Sprintf(":d-%s", v), fmt.Sprint(true))
  34. return b
  35. }
  36. func (b *VContainerBuilder) GridList(s SizeType) (r *VContainerBuilder) {
  37. b.tag.Attr(fmt.Sprintf(":grid-list-%s", s), fmt.Sprint(true))
  38. return b
  39. }