diff --git a/beike/Admin/View/Components/Form/Input.php b/beike/Admin/View/Components/Form/Input.php index 521bf2d0..7f925838 100644 --- a/beike/Admin/View/Components/Form/Input.php +++ b/beike/Admin/View/Components/Form/Input.php @@ -16,19 +16,22 @@ class Input extends Component public string $width; + public string $placeholder; + public string $type; public string $step; public bool $required; - public function __construct(string $name, string $title, string $value, bool $required = false, string $error = '', string $width = '400', string $type = 'text', string $step = '') + public function __construct(string $name, string $title, string $value, bool $required = false, string $error = '', string $width = '400', string $type = 'text', string $step = '', string $placeholder = '') { $this->name = $name; $this->title = $title; $this->value = html_entity_decode($value, ENT_QUOTES); $this->error = $error; $this->width = $width; + $this->placeholder = $placeholder; $this->type = $type; $this->step = $step; $this->required = $required; diff --git a/beike/Admin/View/Components/Form/InputLocale.php b/beike/Admin/View/Components/Form/InputLocale.php index 6b81a348..3b6c2377 100644 --- a/beike/Admin/View/Components/Form/InputLocale.php +++ b/beike/Admin/View/Components/Form/InputLocale.php @@ -14,15 +14,18 @@ class InputLocale extends Component public string $width; + public string $placeholder; + public $value; public bool $required; - public function __construct(string $name, string $title, $value, string $width = '400', bool $required = false) + public function __construct(string $name, string $title, $value, string $width = '400', bool $required = false, string $placeholder = '') { $this->name = $name; $this->title = $title; $this->width = $width; + $this->placeholder = $placeholder; $this->value = $value; $this->required = $required; } diff --git a/resources/beike/admin/views/components/form/input-locale.blade.php b/resources/beike/admin/views/components/form/input-locale.blade.php index 49941434..a3f33bc1 100644 --- a/resources/beike/admin/views/components/form/input-locale.blade.php +++ b/resources/beike/admin/views/components/form/input-locale.blade.php @@ -3,7 +3,7 @@
{{ $locale['name'] }} + class="form-control short" placeholder="{{ $placeholder ?: $locale['name'] }}" @if ($required) required @endif> {{ __('common.error_required', ['name' => $title]) }}
diff --git a/resources/beike/admin/views/components/form/input.blade.php b/resources/beike/admin/views/components/form/input.blade.php index 10ff2413..eddb6322 100644 --- a/resources/beike/admin/views/components/form/input.blade.php +++ b/resources/beike/admin/views/components/form/input.blade.php @@ -1,7 +1,7 @@ + placeholder="{{ $placeholder ?: $title }}" @if ($required) required @endif @if ($step) step="{{ $step }}" @endif> @if ($error) {{ $error }} diff --git a/resources/beike/admin/views/pages/plugins/form.blade.php b/resources/beike/admin/views/pages/plugins/form.blade.php index 9bb1f3d3..805f9a1d 100644 --- a/resources/beike/admin/views/pages/plugins/form.blade.php +++ b/resources/beike/admin/views/pages/plugins/form.blade.php @@ -21,6 +21,7 @@ @@ -30,6 +31,7 @@