Using vue-router in laravel, how to use html5 history
给我你的怀抱2017-05-16 16:46:44
0
2
679
How to use html5 history when using vue-router in laravel? If new VueRouter({mode:'history',...}); is used, there will be no 127.0.0.1/#/ in the URL article, such # appears, and the route is not found. . Waiting online. . . .
Transfer HttpException to your View in the exception handling Handler for processing! The remaining requests can only be made in API mode
Testing laravel 5.4
Only routes are defined in web routing.
vue-router
Enablinghistorymode requires the support of the backend server.If the server isApache, the configuration is as follows:
If the server isNginx, the configuration is as follows:
See official website documentation for details.
If the front-end is responsible for routing and the back-end only provides interfaces.
Routes for interfaces are best defined in
routes/api.php
.