RichText 命名优化

This commit is contained in:
Edward Yang 2023-01-30 18:37:02 +08:00
parent e00ad4f241
commit 9b484e03f2
4 changed files with 5 additions and 5 deletions

View File

@ -140,7 +140,7 @@ class AdminServiceProvider extends ServiceProvider
'form-select' => Select::class,
'form-image' => Image::class,
'form-textarea' => Textarea::class,
'form-richtext' => Richtext::class,
'form-rich-text' => RichText::class,
'no-data' => NoData::class,
]);
}

View File

@ -4,7 +4,7 @@ namespace Beike\Admin\View\Components\Form;
use Illuminate\View\Component;
class Richtext extends Component
class RichText extends Component
{
public string $name;
@ -14,7 +14,7 @@ class Richtext extends Component
public bool $required;
public function __construct(string $name, string $title, ?string $value, bool $required = false)
public function __construct(string $name, string $title, string $value = '', bool $required = false)
{
$this->name = $name;
$this->title = $title;
@ -24,6 +24,6 @@ class Richtext extends Component
public function render()
{
return view('admin::components.form.richtext');
return view('admin::components.form.rich-text');
}
}

View File

@ -59,7 +59,7 @@
</x-admin-form-textarea>
@endif
@if ($column['type'] == 'richtext')
@if ($column['type'] == 'rich-text')
<x-admin-form-richtext
:name="$column['name']"
:title="$column['label']"