diff --git a/beike/Admin/View/Components/Form/Input.php b/beike/Admin/View/Components/Form/Input.php index 720de18c..1782f72a 100644 --- a/beike/Admin/View/Components/Form/Input.php +++ b/beike/Admin/View/Components/Form/Input.php @@ -11,15 +11,17 @@ class Input extends Component public string $value; public string $error; public string $width; + public string $type; public bool $required; - public function __construct(string $name, string $title, ?string $value, bool $required = false, ?string $error = '', ?string $width = '400') + public function __construct(string $name, string $title, ?string $value, bool $required = false, ?string $error = '', ?string $width = '400', ?string $type = 'text') { $this->name = $name; $this->title = $title; $this->value = $value; $this->error = $error; $this->width = $width; + $this->type = $type; $this->required = $required; } diff --git a/resources/beike/admin/views/components/form/input.blade.php b/resources/beike/admin/views/components/form/input.blade.php index 26e09c4e..d5bf0319 100644 --- a/resources/beike/admin/views/components/form/input.blade.php +++ b/resources/beike/admin/views/components/form/input.blade.php @@ -1,5 +1,5 @@ - diff --git a/resources/beike/admin/views/pages/products/form/form.blade.php b/resources/beike/admin/views/pages/products/form/form.blade.php index 02ede580..f62346d9 100644 --- a/resources/beike/admin/views/pages/products/form/form.blade.php +++ b/resources/beike/admin/views/pages/products/form/form.blade.php @@ -11,14 +11,17 @@ @endpush @section('content') - @if ($errors->has('error')) - + @endif @if ($errors->any()) - @dump($errors) +
+ @foreach ($errors->all() as $error) +
{{ $error }}
+ @endforeach +
@endif