add router and route containers

This commit is contained in:
2017-01-31 19:29:54 -07:00
parent 7c48412bbe
commit 72cc7ae89d
6 changed files with 129 additions and 28 deletions

41
src/router.js Normal file
View File

@@ -0,0 +1,41 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App.vue';
import Customers from './containers/Customers.vue';
import Orders from './containers/Orders.vue';
import About from './containers/About.vue';
Vue.use(VueRouter);
const routes = [{
path: '/',
name: 'app',
component: App,
children: [
{
path: 'customers',
name: 'customers',
component: Customers,
}, {
path: 'orders',
name: 'orders',
component: Orders,
}, {
path: 'about',
name: 'about',
component: About,
}, {
path: '*',
redirect: 'customers',
},
],
}];
const router = new VueRouter({
mode: 'hash',
routes,
});
export default router;