content = $content; $this->callback = $callback; } /** * 设置大小 * @param int $size * @return $this */ public function size(int $size): self { $this->size = $size; return $this; } /** * @return array */ public function render(): array { $icon = $this->content; if (strpos($icon, ' 'n-icon', 'size' => $this->size, 'child' => [ 'nodeName' => 'rich-text', 'class' => implode(' ', $this->class), 'nodes' => $icon ] ]; } return [ 'nodeName' => 'icon-' . $icon, 'class' => implode(' ', $this->class), ]; } }