From b88afed28642798ab837742e86a04cec636a5f7c Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Tue, 30 Aug 2022 16:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Admin/View/Components/Form/Input.php | 4 ++- .../views/components/form/input.blade.php | 2 +- .../views/pages/products/form/form.blade.php | 25 +++++++++++-------- 3 files changed, 18 insertions(+), 13 deletions(-) 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