优化后台表单
This commit is contained in:
parent
5bb0fb7e61
commit
68b596bbbe
|
|
@ -9,12 +9,14 @@ class Input extends Component
|
|||
public string $name;
|
||||
public string $title;
|
||||
public string $value;
|
||||
public bool $required;
|
||||
|
||||
public function __construct(string $name, string $title, ?string $value)
|
||||
public function __construct(string $name, string $title, ?string $value, bool $required = false)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->title = $title;
|
||||
$this->value = $value ?? '';
|
||||
$this->required = $required ?? false;
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -317,6 +317,14 @@
|
|||
width: 100px;
|
||||
}
|
||||
|
||||
.col-form-label.required::before {
|
||||
content: "*";
|
||||
color: #f56c6c;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.help-text {
|
||||
color: #B2B2B2;
|
||||
margin-top: 4px;
|
||||
|
|
|
|||
|
|
@ -338,6 +338,14 @@ body[class^=page-account-] {
|
|||
width: 100px;
|
||||
}
|
||||
|
||||
.col-form-label.required::before {
|
||||
content: "*";
|
||||
color: #f56c6c;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.module-title {
|
||||
font-size: 1.5rem;
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
.col-form-label.required {
|
||||
&::before {
|
||||
content: "*";
|
||||
color: #f56c6c;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.help-text {
|
||||
color: #B2B2B2;
|
||||
margin-top: 4px;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<x-admin::form.row :title="$title">
|
||||
<x-admin::form.row :title="$title" :required="$required">
|
||||
<input type="text" name="{{ $name }}" class="form-control wp-400" value="{{ $value }}" placeholder="{{ $title }}">
|
||||
{{ $slot }}
|
||||
</x-admin::form.row>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,6 @@
|
|||
<div class="row g-3 mb-3">
|
||||
<label for="" class="wp-200 col-form-label text-end">{{ $title ?? '' }}</label>
|
||||
<label for="" class="wp-200 col-form-label text-end {{ isset($required) && $required ? 'required' : '' }}">{{ $title ?? '' }}</label>
|
||||
<div class="col-auto wp-200-">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (0)
|
||||
<div class="el-form-item el-form-item--small">
|
||||
<label for="" class="el-form-item__label" style="width: 200px">{{ $title ?? '' }}</label>
|
||||
<div class="el-form-item__content" style="margin-left: 200px">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<div class="help-text font-size-12 lh-base">默认货币设置</div>
|
||||
</x-admin-form-select>
|
||||
|
||||
<x-admin-form-input name="admin_name" title="后台目录" value="{{ old('admin_name', system_setting('base.admin_name', 'admin')) }}">
|
||||
<x-admin-form-input name="admin_name" title="后台目录" required value="{{ old('admin_name', system_setting('base.admin_name', 'admin')) }}">
|
||||
<div class="help-text font-size-12 lh-base">管理后台目录,默认为admin</div>
|
||||
</x-admin-form-input>
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,16 @@ body[class^="page-account-"] {
|
|||
}
|
||||
}
|
||||
|
||||
.col-form-label.required {
|
||||
&::before {
|
||||
content: "*";
|
||||
color: #f56c6c;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.module-title {
|
||||
font-size: 1.5rem;
|
||||
text-align: center;
|
||||
|
|
|
|||
Loading…
Reference in New Issue