<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>盲收神器</title>

    <!-- Styles -->
    <link rel="shortcut icon" href="{{asset('icon/WcsIcon_blindPack.ico')}}" />
    <link rel="bookmark" href="{{asset('icon/WcsIcon_blindPack.ico')}}" />
    <link href="{{ mix('css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
    <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm" id="nav1">
        <div class="container">
            <span class="navbar-brand">
                盲收神器
            </span>
        </div>
    </nav>
    @yield('content')
</div>
</body>
<!-- Scripts -->
@yield('script_before')
{{-- 必须在app.js前边--}}
<script src="{{ mix('js/app.js') }}"></script>
<script>
    let isActive=function (name,atSlashLevel) {
        let uriWithNoParam=location.href.split('?')[0];
        let uriParts=uriWithNoParam.split('//')[1].split('/');
        if(!name){
            return uriParts.length===atSlashLevel;
        }
        if(atSlashLevel>uriParts.length||!atSlashLevel)return false;
        return uriParts[atSlashLevel]===name;
    };
    new Vue({
        el:'#nav1',
        methods:{
            isActive:isActive,
        }
    });
    if($('#nav2').length>0)
        new Vue({
            el:'#nav2',
            methods:{
                isActive:isActive,
            }
        });
</script>
@yield('script_after')
</html>
