Laravelの研究ノート(31)ブートストラップテンプレート研究(モーダル、成分)の一部

  1. モーダル&構成部材

B4-モーダルデフォルト

それ以外の場合は、何の応答を提出しません、フォームがテーブルの外側に配置されている必要があり、注意してください。

<button data-toggle="modal" data-target="#modelId" type="button" class="btn btn-success">添加角色</button>
@component('components.modal', ['id'=>'modelId', 'title'=>'添加角色', 'url'=>'admin/role'])
    <div class="form-group">
        <label>Email_address</label>
        <input type="email" name="email" placeholder="[email protected]" class="form-control">
    </div>

    <div class="form-group">
        <label>Your name</label>
        <input type="text" name="name" placeholder="ABC" class="form-control">
    </div>
@endcomponent

{{$スロット}}コンポーネントロケータであります

// view/components/modal.blade.php
<form action="{{$url}}" method="post">
    @csrf
    @isset($method)
        @method($method)
    @endisset
    <div id="{{$id}}" tabindex="-1" role="dialog" class="modal fade colored-header colored-header-primary show"
                   style="padding-right: 17px;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header modal-header-colored">
                    <h3 class="modal-title">
                        {{$title}}
                    </h3>
                    <button type="button" data-dismiss="modal" aria-hidden="true" class="close md-close"><span
                                class="mdi mdi-close">       </span></button>
                </div>
                <div class="modal-body">
                    {{$slot}}
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary md-close">保存</button>
                </div>
            </div>
        </div>
    </div>
</form>
公開された40元の記事 ウォンの賞賛0 ビュー759

おすすめ

転載: blog.csdn.net/qj4865/article/details/104418443