diff --git a/lib/zin/func.php b/lib/zin/func.php index 8e729845f5..f7aca96316 100644 --- a/lib/zin/func.php +++ b/lib/zin/func.php @@ -1181,6 +1181,11 @@ function dashboard() * string title * string|array|null content * bool useHtml=false + * + * ====== blocks ====== + * subTitle => array() + * actions => array() + * ==================== */ function section() { @@ -1193,6 +1198,10 @@ function section() * string|int|null entityID * string|int|null level * string text + * + * ====== blocks ====== + * suffix = array() + * ==================== */ function entityLabel() { diff --git a/lib/zin/wg/entitylabel/v1.php b/lib/zin/wg/entitylabel/v1.php index 4bc30dac10..071563d759 100644 --- a/lib/zin/wg/entitylabel/v1.php +++ b/lib/zin/wg/entitylabel/v1.php @@ -12,6 +12,10 @@ class entityLabel extends wg 'text: string' // 实体文本 ); + protected static $defineBlocks = array( + 'suffix' => array() + ); + protected function onAddChild(mixed $child): mixed { if(is_string($child) && !$this->props->has('text')) @@ -47,14 +51,16 @@ class entityLabel extends wg protected function build(): wg { - $entityID = $this->buildEntityID(); + $suffix = $this->block('suffix'); + $entityID = $this->buildEntityID(); $entityName = $this->buildEntityName(); return div ( setClass('entity-label', 'flex', 'items-center'), set($this->props->skip(array_keys(static::getDefinedProps()))), $entityID, - $entityName + $entityName, + $suffix ); } }