window-item.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VWindowItemBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VWindowItem(children ...h.HTMLComponent) (r *VWindowItemBuilder) {
  11. r = &VWindowItemBuilder{
  12. tag: h.Tag("v-window-item").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VWindowItemBuilder) ActiveClass(v string) (r *VWindowItemBuilder) {
  17. b.tag.Attr("active-class", v)
  18. return b
  19. }
  20. func (b *VWindowItemBuilder) Disabled(v bool) (r *VWindowItemBuilder) {
  21. b.tag.Attr(":disabled", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VWindowItemBuilder) Eager(v bool) (r *VWindowItemBuilder) {
  25. b.tag.Attr(":eager", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VWindowItemBuilder) ReverseTransition(v bool) (r *VWindowItemBuilder) {
  29. b.tag.Attr(":reverse-transition", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VWindowItemBuilder) Transition(v bool) (r *VWindowItemBuilder) {
  33. b.tag.Attr(":transition", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VWindowItemBuilder) Value(v interface{}) (r *VWindowItemBuilder) {
  37. b.tag.Attr(":value", h.JSONString(v))
  38. return b
  39. }
  40. func (b *VWindowItemBuilder) SetAttr(k string, v interface{}) {
  41. b.tag.SetAttr(k, v)
  42. }
  43. func (b *VWindowItemBuilder) Attr(vs ...interface{}) (r *VWindowItemBuilder) {
  44. b.tag.Attr(vs...)
  45. return b
  46. }
  47. func (b *VWindowItemBuilder) Children(children ...h.HTMLComponent) (r *VWindowItemBuilder) {
  48. b.tag.Children(children...)
  49. return b
  50. }
  51. func (b *VWindowItemBuilder) AppendChildren(children ...h.HTMLComponent) (r *VWindowItemBuilder) {
  52. b.tag.AppendChildren(children...)
  53. return b
  54. }
  55. func (b *VWindowItemBuilder) PrependChildren(children ...h.HTMLComponent) (r *VWindowItemBuilder) {
  56. b.tag.PrependChildren(children...)
  57. return b
  58. }
  59. func (b *VWindowItemBuilder) Class(names ...string) (r *VWindowItemBuilder) {
  60. b.tag.Class(names...)
  61. return b
  62. }
  63. func (b *VWindowItemBuilder) ClassIf(name string, add bool) (r *VWindowItemBuilder) {
  64. b.tag.ClassIf(name, add)
  65. return b
  66. }
  67. func (b *VWindowItemBuilder) On(name string, value string) (r *VWindowItemBuilder) {
  68. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  69. return b
  70. }
  71. func (b *VWindowItemBuilder) Bind(name string, value string) (r *VWindowItemBuilder) {
  72. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  73. return b
  74. }
  75. func (b *VWindowItemBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  76. return b.tag.MarshalHTML(ctx)
  77. }