import Vue from 'vue' import Router from 'vue-router' import Home from './views/Home/' Vue.use(Router) export default new Router({ mode: 'history', routes: [ { path: '/', name: 'home', component: Home } ] }) パス/にアクセスすると、<router-view>の中身がHomeコンポーネントとして置換される。 また、デフォルトの挙動ではURLに#が含まれるが、mode:historyを指定することでURLからhashを取り除くことができる。 ③エントリポイントとなるJavaScriptファイルに記述を追加する