初始化
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@php
|
||||
$isEdit = isset($menu) && $menu;
|
||||
@endphp
|
||||
|
||||
@section('title', $isEdit ? '编辑菜单' : '新建菜单')
|
||||
@section('page-title', $isEdit ? '编辑菜单' : '新建菜单')
|
||||
@section('actions')
|
||||
<a href="{{ route('admin.menus.index') }}" class="btn btn-sm">返回列表</a>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ $isEdit ? route('admin.menus.update', $menu) : route('admin.menus.store') }}">
|
||||
@csrf
|
||||
@if ($isEdit) @method('PUT') @endif
|
||||
|
||||
<div class="field">
|
||||
<label>菜单文字 *</label>
|
||||
<input name="label" class="input" value="{{ old('label', $menu->label ?? '') }}" placeholder="例如:产品服务" maxlength="60" required>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>链接地址 *</label>
|
||||
<input name="url" class="input" value="{{ old('url', $menu->url ?? '') }}" placeholder="站内路径如 /products 或完整外链 https://..." maxlength="255" required>
|
||||
<p class="form-hint">站内页面填写相对路径(以 / 开头),外链填写完整 https:// 地址。</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>排序</label>
|
||||
<input name="sort_order" type="number" class="input" value="{{ old('sort_order', $menu->sort_order ?? 0) }}" style="max-width:160px">
|
||||
<p class="form-hint">数字越小越靠前,相同则按添加先后排列。</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="inline-flex items-center gap-2">
|
||||
<input type="checkbox" name="is_visible" value="1" {{ old('is_visible', $menu->is_visible ?? true) ? 'checked' : '' }}>
|
||||
在前台显示
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary">保存</button>
|
||||
<a href="{{ route('admin.menus.index') }}" class="btn">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user