边栏导致vue错误laravel

时间:2017-11-14 01:30:48

标签: php laravel sidebar

我需要一些帮助来检查我的侧边栏菜单是否有任何问题,也可能是我将侧边栏放在app.blade.php中的位置。因为每次我尝试在app.blade.php中添加它,我都会得到一个vue错误,在这种情况下我根本没有安装vue或更新laravel。在过去,我的侧边栏菜单工作正常所以代码应该没问题,所以我想是因为定位?

app.blade.php

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

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

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
    <div id="app">
        <nav class="navbar navbar-default navbar-static-top">
            <div class="container">
                <div class="navbar-header">


                    <!-- Collapsed Hamburger -->
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse" aria-expanded="false">
                        <span class="sr-only">Toggle Navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    @include('layouts.sidebar')

                    <!-- Branding Image -->
                    <a class="navbar-brand" href="{{ url('/') }}" style="color: white">
                        {{ config('app.name', 'Laravel') }}
                    </a>
                </div>

                <div class="collapse navbar-collapse" id="app-navbar-collapse">
                    <!-- Left Side Of Navbar -->
                    <ul class="nav navbar-nav">

                        &nbsp;
                    </ul>

                    <div id="center-text">
                        <ul class="nav navbar-nav navbar-center" id="nav-center">
                            <li>
                                <h3>@yield('title')</h3>
                            </li>
                        </ul>
                    </div>


                    <!-- Right Side Of Navbar -->
                    <ul class="nav navbar-nav navbar-right">
                        <!-- Authentication Links -->
                        @guest
                            <li><a href="{{ route('login') }}">Login</a></li>
                            <li><a href="{{ route('register') }}">Register</a></li>
                        @else
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" style="background-color:blue" style="color:white">
                                    <b>{{ Auth::user()->name }}</b> <span class="caret"></span>
                                </a>

                                <ul class="dropdown-menu" style="background-color: blue">
                                    <li>
                                        <a href="{{ route('logout') }}"
                                            onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();" style="background-color: blue" style="color: white">
                                            <b>Logout</b>
                                        </a>

                                        <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                            {{ csrf_field() }}
                                        </form>
                                    </li>
                                </ul>
                            </li>
                        @endguest
                    </ul>
                </div>
            </div>
        </nav>

        @yield('content')
    </div>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}"></script>

</body>
</html>

sidebar.blade.php

<html>
<head>
              <title>SideBar Menu</title>
     <link href="{{ asset('css/style.css') }}" rel="stylesheet">
</head>

<body>

    <div id="sidebar">

        <ul>
            <li><a href="{{route('home')}}">Summary</a></li>                 
            <li><a href="{{route('deleted_result')}}">Deleted Records</a></li>
             <li><a href="{{url('/verification')}}">Verification</a></li>
             <li><a href="{{url('/evaltest')}}">Eval Test</a></li>
            <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit User Information <span class="caret"></span></a>
          <ul class="dropdown-menu forAnimate" role="menu">
            <li><a href="{{ url('/edit') }}" style="color: red">Personal Information Edit</a></li>
            <li><a href="{{ url('/edit0')}}" style="color: red">Driver License 
          </ul>
        </li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Evaluation <span class="caret"></span></a>
          <ul class="dropdown-menu forAnimate" role="menu">
             <li><a href="{{ url('/edit8')}}" style="color: red">Evaluation</a></li>
              <li><a href="{{ url('/shirtSize')}}" style="color: red">Shirt Size</a></li>

          </ul>
        </li>

        </ul>

        <div id="sidebar-btn">
            <span></span>
            <span></span>
            <span></span>
        </div>

    </div>


    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>

    $(document).ready(function(){
        $('#sidebar-btn').click(function(){
            $('#sidebar').toggleClass('visible');
        });
    });

    </script>
    </body>
    </html>

0 个答案:

没有答案