nodes[] = [ 'nodeName' => 'a-button', 'type' => 'secondary', 'status' => $btnType, 'child' => $name, 'vOn:click' => "footer.checkAction('$url', '确定执行$name\操作?')" ]; return $this; } /** * @param string $name * @param string $route * @param array $params * @return $this */ public function select(string $name, string $route = '', array $params = []): self { $url = route($route, $params); $this->select[] = [ 'nodeName' => 'a-doption', 'child' => $name, 'vOn:click' => "footer.checkAction('$url' '确定执行$name\操作?')" ]; return $this; } /** * 渲染组件 * @return array */ public function render(): array { if ($this->select) { $this->nodes[] = [ 'nodeName' => 'a-dropdown', 'child' => [ [ 'nodeName' => 'a-button', 'type' => 'secondary', 'child' => '批量操作', ], [ 'vSlot:content' => '', 'nodeName' => 'div', 'child' => $this->select ] ], ]; } return $this->nodes; } }