#jquery在vue中{错误抛出

时间:2018-02-07 17:31:46

标签: jquery laravel

我是新来的vue请帮助我做错了什么 这是我的欢迎刀片

 <!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">
         <meta name="csrf-token" content="{{ csrf_token() }}">     

          <link rel="shortcut icon" href="{{asset('homepage/images/favicon.ico')}}">     

         <title>Minton - Responsive Admin Dashboard & Frontend</title>     

         <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500' rel='stylesheet' type='text/css'>
         <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>     

         <!-- Bootstrap core CSS -->
         <link href="{{asset('homepage/css/bootstrap.min.css')}}" rel="stylesheet">     

         <!-- Animate -->
         <link href="{{asset('homepage/css/animate.css')}}" rel="stylesheet">     

         <!-- Icon-font -->
         <link rel="stylesheet" type="text/css" href="{{asset('homepage/css/themify-icons.css')}}">     

         <!-- Custom styles for this template -->
         <link href="{{asset('homepage/css/style.css')}}" rel="stylesheet">

     </head>
     <body>
       <div id="app">

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

         <script src="{{asset('homepage/js/popper.min.js')}}"></script>
         <script src="{{asset('homepage/js/bootstrap.min.js')}}"></script>
         <!-- Jquery easing -->
         <script type="text/javascript" src="{{asset('homepage/js/jquery.easing.1.3.min.js')}}">
       </script>
         <script src="{{asset('homepage/js/SmoothScroll.js')}}"></script>
         <script src="{{asset('homepage/js/wow.min.js')}}"></script>
         <script src="{{asset('homepage/js/jquery.waypoints.min.js')}}" type="text/javascript">
       </script>
         <script src="{{asset('homepage/js/jquery.counterup.min.js')}}" type="text/javascript">
       </script>     

         <!--common script for all pages-->
         <script src="{{asset('homepage/js/jquery.app.js')}}"></script>     

         <script type="text/javascript">
             jQuery(document).ready(function($) {
                 $('.counter').counterUp({
                     delay: 100,
                     time: 1200
                 });
             });
         </script>
     </body>
 </html>

在欢迎vue页面,我有登录按钮

           <li class="nav-item">
          <router-link :to="'/login'" class="nav-link" exact><i class="icon-puzzle"></i> 
              Login</router-link>
        </li>

以上所有代码都正常工作,但不知道为什么它会抛出未捕获的错误:语法错误,无法识别的表达式:#/ login in jquery  如果是的话我怎么能解决这种问题的网址像localhost / vue / public /#/ login而且如果我刷新页面问题就会消失,这就是jquery问题或者vue。

1 个答案:

答案 0 :(得分:1)

双引号括起来的单引号在router-link中是不必要的。

<router-link :to="/login"></router-link>

<router-link :to='/login'></router-link>