Files
xk-api-yii/admin/components/UI/Layout.php
2024-09-19 11:32:39 +08:00

50 lines
1.2 KiB
PHP

<?php
namespace admin\components\UI;
use admin\components\UI\Components\VueComponent;
class Layout extends VueComponent
{
private string $name='app-layout';
private string $class='flex-grow w-10';
private string $title;
public function __construct($title){
$this->title = $title;
}
public $child = [];
function setup(string $script)
{
// TODO: Implement setup() method.
}
public function addChild($node){
$this->child[] = $node;
}
function render()
{
return ['node'=>[
"nodeName" => "div",
"class" => "flex h-screen",
"vSlot" => "{value: data}",
"child" => [
[
'nodeName' => $this->name,
'class' => $this->class,
'title' => $this->title,
'child' => [
[
'nodeName' => 'div',
'class' => 'p-4',
'child' => $this->child
]
]
]
],
'setupScript'=>"\n return {}"
]];
// TODO: Implement render() method.
}
}