search

Home  >  Q&A  >  body text

vue.js - laravel5.3+vue2, vue cannot be loaded using nginx configuration

laravel5.3 + vue2, the project is created directly by composer

routing

Route::group(['prefix' => 'admin'], function () {
    Route::get('{path?}', function (){
        return view('index');
    })->where('path', '[\/\w\.-]*');
});

indextemplate

<body>
<p id="app" style="width: 100%;height: 100%">
    <app></app>
</p>
<script src="{{ elixir('js/app.js') }}"></script>
</body>

Two ways
1. PHP+nginx, access does not load app.js, no output, no vue component parsed

2. Laravel comes with artisan to start php artist serve. There is output when accessing, and you can see the vue interface

怪我咯怪我咯2759 days ago762

reply all(1)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 16:50:19

    Use nginx to access, vue needs to be packaged into a production environment, just npm run prod

    reply
    0
  • Cancelreply