Closed hasyrails closed 3 years ago
Vue.js入門 #08 4章 Vue Routerの高度な機能/Qiita
var router = new VueRouter({
routes: [
// いずれにもマッチしなかった場合
{ path: '*', redirect: '/' }, // ホーム画面へ戻す
]
})
var router = new VueRouter({
routes: [
{ path: '/notfound', component: NotFound },
// いずれにもマッチしなかった場合
{ path: '*', redirect: '/notfound' },
]
})
どちらで実装するか
意図しないurl遷移は全て
'/'
へ遷移するよう実装する