はじめに Vue.jsのRouterの書き方はいくつかがありますので、まとめてみます。 1. インストール npm install vue-router 2. appに導入 const routes = [ { path: '/foo', component: Foo }, { path: '/bar', component: Bar } ] const router = new VueRouter({ routes }) const app = new Vue({ router }).$mount('#app')