ルーターの指定が正しいのに、うまく機能しない場合は、hrefの指定が間違っている可能性があります。
以下のようにルーティングが設定されているとします。
const routes = {
routes: [
{
path: '/',
name: 'hoge-page',
component: require('@/components/HogePage').default
},
{
path: '/fuga',
name: 'fuga-page',
component: require('@/components/FugaPage').default
},
{
path: '*',
redirect: '/'
}
]
}
この場合ヘッダーメニューが次のように指定されていると、production環境では、うまく機能しません。
href="/" href="/fuga"修正後
href="#/" href="#/fuga"このようにすることで、画面遷移できるようになるするはずです。