diff --git a/2021-03-27_routing-01-starting-setup/src/App.vue b/2021-03-27_routing-01-starting-setup/src/App.vue index 915ae1e..28eb094 100644 --- a/2021-03-27_routing-01-starting-setup/src/App.vue +++ b/2021-03-27_routing-01-starting-setup/src/App.vue @@ -1,20 +1,16 @@ @@ -59,4 +55,4 @@ html { body { margin: 0; } - \ No newline at end of file + diff --git a/2021-03-27_routing-01-starting-setup/src/components/nav/TheNavigation.vue b/2021-03-27_routing-01-starting-setup/src/components/nav/TheNavigation.vue index 8cfcb47..5b8a982 100644 --- a/2021-03-27_routing-01-starting-setup/src/components/nav/TheNavigation.vue +++ b/2021-03-27_routing-01-starting-setup/src/components/nav/TheNavigation.vue @@ -19,8 +19,8 @@ export default { methods: { setActivePage(page) { this.$emit('set-page', page); - }, - }, + } + } }; @@ -65,4 +65,4 @@ button:active { border-color: #f1a80a; background-color: #1a037e; } - \ No newline at end of file + diff --git a/2021-03-27_routing-01-starting-setup/src/main.js b/2021-03-27_routing-01-starting-setup/src/main.js index c3b2ef1..b660f42 100644 --- a/2021-03-27_routing-01-starting-setup/src/main.js +++ b/2021-03-27_routing-01-starting-setup/src/main.js @@ -1,9 +1,21 @@ import { createApp } from 'vue'; +import { createRouter, createWebHistory } from 'vue-router'; import App from './App.vue'; +import TeamsList from './components/teams/TeamsList'; +import UsersList from './components/users/UsersList'; const app = createApp(App); +const router = createRouter({ + history: createWebHistory(), + routes: [ + { path: '/teams', component: TeamsList }, + { path: '/users', component: UsersList } + ] +}); + +app.use(router); app.mount('#app'); if (module.hot) {