From 3b1246533dba93453edb6703e3c0b510a26da51c Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sun, 16 May 2021 17:23:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC=E5=A4=B4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/library/table/HeaderItem.php | 74 ++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/extend/catcher/library/table/HeaderItem.php b/extend/catcher/library/table/HeaderItem.php index 450e39e..5298c6c 100644 --- a/extend/catcher/library/table/HeaderItem.php +++ b/extend/catcher/library/table/HeaderItem.php @@ -7,6 +7,10 @@ class HeaderItem protected $attributes = []; + /** + * HeaderItem constructor. + * @param string $label + */ public function __construct(string $label) { $this->attributes['label'] = $label; @@ -16,11 +20,25 @@ class HeaderItem return $this; } + /** + * label + * + * @time 2021年05月15日 + * @param string $label + * @return HeaderItem + */ public static function label(string $label = ''): HeaderItem { return new self($label); } + /** + * prop + * + * @time 2021年05月15日 + * @param string $prop + * @return $this + */ public function prop(string $prop): HeaderItem { $this->attributes['prop'] = $prop; @@ -28,13 +46,27 @@ class HeaderItem return $this; } + /** + * 宽度 + * + * @time 2021年05月15日 + * @param string $width + * @return $this + */ public function width(string $width): HeaderItem { $this->attributes['width'] = $width; return $this; } - + + /** + * align 宽度 + * + * @time 2021年05月15日 + * @param string $align + * @return $this + */ public function align(string $align): HeaderItem { $this->attributes['align'] = $align; @@ -42,6 +74,39 @@ class HeaderItem return $this; } + /** + * 居中 + * + * @time 2021年05月15日 + * @return $this + */ + public function alignCenter(): HeaderItem + { + $this->attributes['align'] = 'center'; + + return $this; + } + + /** + * 居右 + * + * @time 2021年05月15日 + * @return $this + */ + public function alignRight(): HeaderItem + { + $this->attributes['align'] = 'right'; + + return $this; + } + + /** + * 操作 + * + * @time 2021年05月15日 + * @param array $actions + * @return $this + */ public function actions(array $actions): HeaderItem { foreach ($actions as $action) { @@ -51,6 +116,13 @@ class HeaderItem return $this; } + /** + * 冒泡点击 + * + * @time 2021年05月15日 + * @param false $bubble + * @return $this + */ public function isBubble($bubble = false): HeaderItem { $this->attributes['isBubble'] = $bubble;