November 2019
Beginner
804 pages
20h 1m
English
Now that we have a first view (even if an overly simplistic one), we can display it. To do so, we will now install and configure Vue Router in our application:
npm install vue-router
import VueRouter from 'vue-router';import Home from '@/views/Home.vue';export const router = new VueRouter({ mode: 'history', base: '', // useful for sub-domains routes: [ { path: '/', component: Home }, { path: '/home', component: Home }, { path: '*', redirect: '/' }, ],});
There are a few things to know about this code:
Read now
Unlock full access