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
Use nginx to access, vue needs to be packaged into a production environment, just npm run prod