vue.js - laravel5.3+vue2, vue cannot be loaded using nginx configuration
怪我咯
怪我咯 2017-05-16 16:48:19
0
1
766

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

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
给我你的怀抱

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template