【发布时间】:2021-10-04 15:46:31
【问题描述】:
我正在使用 laravel 和 vue js 开发一个应用程序,我正在尝试从我的 URL 中删除 #。通常我的网址看起来像这样。
http://localhost/foo/?#/admin
使用App.js 进行这些设置
const router = new VueRouter({
routes: routes,
});
还有web.php
Route::get('/', function () {
return view('base');
});
但是在更改了这些设置之后。我得到了这样的预期网址。 http://localhost/foo/admin。但问题是页面没有加载或渲染,基本上我的页面变成了空白页面。
使用App.js的设置
const router = new VueRouter({
mode: 'history',
routes: routes,
});
还有web.php
Route::get('/{any}', function () {
return view('base');
})->where('any', '.*');
我遵循了从不同论坛获得的每个解决方案,但它似乎对我不起作用。
【问题讨论】:
标签: laravel vue.js vue-router laravel-routing