- Home |
+ Home|
About
@@ -10,7 +10,7 @@
diff --git a/src/main.js b/src/main.js
index 3a47006..bd58e31 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,12 +1,12 @@
-import Vue from "vue";
-import App from "./App.vue";
-import router from "./router";
-import store from "./store";
+import Vue from 'vue'
+import App from './App.vue' //Root component all components stem from
+import router from './router'
+import store from './store'
-Vue.config.productionTip = false;
+Vue.config.productionTip = false
new Vue({
- router,
+ router, // in ES6 this is the same as writing router: router
store,
render: h => h(App)
-}).$mount("#app");
+}).$mount('#app')
diff --git a/src/router.js b/src/router.js
index 7b4bb79..6161bd3 100644
--- a/src/router.js
+++ b/src/router.js
@@ -1,26 +1,35 @@
-import Vue from "vue";
-import Router from "vue-router";
-import Home from "./views/Home.vue";
+import Vue from 'vue'
+import Router from 'vue-router'
+import Home from './views/Home.vue'
-Vue.use(Router);
+Vue.use(Router)
export default new Router({
- mode: "history",
+ mode: 'history',
base: process.env.BASE_URL,
routes: [
{
- path: "/",
- name: "home",
+ path: '/',
+ // This is a named route. We can reference this instead of a static path in our router-links.
+ name: 'home',
component: Home
},
{
- path: "/about",
- name: "about",
+ path: '/about-us',
+ name: 'about',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
- import(/* webpackChunkName: "about" */ "./views/About.vue")
+ import(/* webpackChunkName: "about" */ './views/About.vue'),
+ // an alias is also a viable option instead of a redirect like below
+ alias: '/about-alias'
+ },
+ {
+ path: '/about',
+ // here we are specifying the named route for the redirect.
+ // If you weren't using Named Routes you could also do `redirects: '/about-us'`
+ redirect: { name: 'about' }
}
]
-});
+})
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 05494f6..ba230b5 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,18 +1,5 @@
-
-
+
The homepage
-
-