优化错误显示
This commit is contained in:
parent
2e989a3382
commit
d6eee750ec
|
|
@ -9,9 +9,9 @@ class Alert extends Component
|
|||
public string $type;
|
||||
public string $msg;
|
||||
|
||||
public function __construct(string $type, string $msg)
|
||||
public function __construct(?string $type = 'success', string $msg)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->type = $type ?? 'success';
|
||||
$this->msg = $msg;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ class Alert extends Component
|
|||
public string $type;
|
||||
public string $msg;
|
||||
|
||||
public function __construct(string $type, string $msg)
|
||||
public function __construct(?string $type = 'success', string $msg)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->type = $type ?? 'success';
|
||||
$this->msg = $msg;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="alert alert-success alert-dismissible">
|
||||
<div class="alert alert-{{ $type }} alert-dismissible">
|
||||
<i class="bi bi-check-circle-fill"></i>
|
||||
{{ $msg }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
@section('content')
|
||||
|
||||
@if ($errors->has('error'))
|
||||
<x-admin-alert type="Danger" msg="{{ $errors->has('error') }}" class="mt-4" />
|
||||
<x-admin-alert type="danger" msg="{{ $errors->has('error') }}" class="mt-4" />
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
|
|
|
|||
|
|
@ -17,9 +17,8 @@
|
|||
<div class="col-12 col-md-9">@include('shared.steps', ['steps' => 1])</div>
|
||||
</div>
|
||||
|
||||
{{-- @dump($errors) --}}
|
||||
@if ($errors->has('error'))
|
||||
<x-admin-alert type="Danger" msg="{{ $errors->has('error') }}" class="mt-4" />
|
||||
<x-shop-alert type="danger" msg="{{ $errors->has('error') }}" class="mt-4" />
|
||||
@endif
|
||||
|
||||
<div class="row mt-5" v-if="products.length">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="alert alert-success alert-dismissible">
|
||||
<div class="alert alert-{{ $type }} alert-dismissible">
|
||||
<i class="bi bi-check-circle-fill"></i>
|
||||
{{ $msg }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue