示例代码

  1. public function index(Content $content)
  2. {
  3. $content->className('m-15');
  4. $content->row($this->code());
  5. $content->row($this->br());
  6. // 单行单列
  7. $content->row($this->card('col-md-24', '#81C784'));
  8. // 一行多列
  9. $content->row(function (Row $row) {
  10. $row->gutter(15);
  11. $row->column(8, $this->card('col-md-8', '#7986CB'));
  12. $row->column(8, $this->card('col-md-8', '#7986CB'));
  13. $row->column(8, $this->card('col-md-8', '#7986CB'));
  14. });
  15. // 行里面有多个列,列里面再嵌套行
  16. $content->row(function (Row $row) {
  17. $row->gutter(15);
  18. $row->column(18, function (Column $column) {
  19. // 一列多行
  20. $column->row($this->card(['col-md-24', 20], '#4DB6AC'));
  21. // 行里面再嵌套列
  22. $column->row(function (Row $row) {
  23. $row->gutter(15);
  24. $row->column(8, $this->card(['col-md-8', 30], '#80CBC4'));
  25. $row->column(8, $this->card(['col-md-8', 30], '#4DB6AC'));
  26. $row->column(8, function (Column $column) {
  27. $column->row(function (Row $row) {
  28. $row->gutter(15);
  29. $row->column(12, $this->card(['col-md-12', 30], '#26A69A'));
  30. $row->column(12, $this->card(['col-md-12', 30], '#26A69A'));
  31. });
  32. });
  33. });
  34. });
  35. $row->column(6, $this->card(['col-md-6', 120], '#00897B'));
  36. });
  37. return $content;
  38. }

实现效果

截屏2020-09-19 18.13.20.png