Skip to content

Commit

Permalink
- 新增: BaseRenderer 支持 Macro
Browse files Browse the repository at this point in the history
  • Loading branch information
slowlyo committed Nov 13, 2023
1 parent c119023 commit 3f2e9b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Renderers/BaseRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

namespace Slowlyo\OwlAdmin\Renderers;

use Illuminate\Support\Traits\Macroable;

class BaseRenderer implements \JsonSerializable
{
use Macroable {
__call as macroCall;
}

public string $type;

public array $amisSchema = [];
Expand All @@ -15,6 +21,10 @@ public static function make(): static

public function __call($name, $arguments)
{
if (static::hasMacro($name)) {
return $this->macroCall($name, $arguments);
}

return $this->set($name, array_shift($arguments));
}

Expand Down

0 comments on commit 3f2e9b1

Please sign in to comment.