在我的laravel vue应用程序中设置404路由以返回前端组件/页面的问题 .

当我转到特定网址,例如“localhost / myapp / about”时,它不返回该特定组件或页面 . 这就是我的路由器的设置方式 .

const router = new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home
        },
        {
            path: 'about',
            name: 'about',
            component: About,
        },
    ],
});

我已尝试将此添加到laravel中的我的路径文件中但仍有问题

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