InfoBox


InfoBox 定义如下:

  1. type InfoBox struct {
  2. components.Base
  3. Icon template.HTML
  4. Text template.HTML
  5. Number template.HTML
  6. Content template.HTML
  7. Color template.HTML
  8. IsHexColor bool
  9. IsSvg bool
  10. }
  11. func New() InfoBox {}
  12. // 设置icon
  13. func (i InfoBox) SetIcon(value template.HTML) InfoBox {}
  14. // 设置文字
  15. func (i InfoBox) SetText(value template.HTML) InfoBox {}
  16. // 设置数字
  17. func (i InfoBox) SetNumber(value template.HTML) InfoBox {}
  18. // 设置内容
  19. func (i InfoBox) SetContent(value template.HTML) InfoBox {}
  20. // 设置颜色
  21. func (i InfoBox) SetColor(value template.HTML) InfoBox {}

使用:

  1. import "github.com/GoAdminGroup/themes/adminlte/components/infobox"
  2. func xxx() {
  3. ...
  4. content := infobox.New().SetIcon("").SetText().GetContent()
  5. ...
  6. }