<style>
    .layui-table th {
        color: #666;
        text-align: right;
        background-color: #f2f2f2;
    }
</style>
<div @if(request()->ajax()) style="padding:10px 20px;" @endif>
    @if(isset($title) && $title)
        <h2>{{ $title }}
            @if(!request()->ajax())
                <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;" type="button"
                        onclick="javascript:history.go(-1);">返回
                </button>
            @endif
        </h2>
        <hr>
    @endif
    <table class="layui-table">
        @foreach($columns as $key => $column)
            <tr>
                <th style="width: 200px;">{{ $column['name'] }}</th>
                <td>{!! isset($column['value']) ? $column['value']($items[$key]) : $items[$key] !!}</td>
            </tr>
        @endforeach
    </table>

    @if(!request()->ajax())
        <hr>
        <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;" type="button"
                onclick="javascript:history.go(-1);">返回
        </button>
    @endif
</div>

