使用 laravel-6 重新加载页面时 Vue-Router 中断

Vue-Router breaks when reloading page with laravel-6

实际发生了什么? 如果我刷新我的网络浏览器而不是不再识别我的路线

确保你像这样使用路线历史记录

const router = new VueRouter({
  mode: 'history',
});

之前路由中不匹配的所有内容都将由 AppController 提供,returns 包含用于引导 VueJS 应用程序的文件的裸视图。在你的网络路线中,把这个放在你所有路线的底部

 Route::get('/{path}', 'AppController@index')->where( 'path', "([A-z\d\-/_.]+)?" );

查看这篇文章catch routes