Permalink
Browse files

Move router to router.ts

  • Loading branch information...
mythz committed Aug 12, 2018
1 parent b8e724d commit b73662ae8eef813710eaddcf95c5bc4b5a35273f
Showing with 16 additions and 32 deletions.
  1. +1 −17 MyApp/src/main.ts
  2. +15 −15 MyApp/src/router.ts
@@ -4,26 +4,10 @@ import './app.scss';
import 'es6-shim';
import Vue from 'vue';
import Router from 'vue-router';
import App from './App.vue';
import Home from './home/Home.vue';
import View1 from './view1/View1.vue';
import View2 from './view2/View2.vue';
const routes = [
{ path: '/', component: Home, props: { name: 'Vue' } },
{ path: '/view1', component: View1 },
{ path: '/view2', component: View2 },
{ path: '*', redirect: '/' },
];
import router from './router';
const router = new Router ({
mode: 'history',
linkActiveClass: 'active',
routes,
});
Vue.use(Router);
const app = new Vue({
el: '#app',
render: (h) => h(App),
@@ -1,21 +1,21 @@
import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';
import About from './views/About.vue';
import Home from './home/Home.vue';
import View1 from './view1/View1.vue';
import View2 from './view2/View2.vue';
Vue.use(Router);
export default new Router({
routes: [
{
path: '/',
name: 'home',
component: Home,
},
{
path: '/about',
name: 'about',
component: About,
},
],
const routes = [
{ path: '/', component: Home, props: { name: 'Vue' } },
{ path: '/view1', component: View1 },
{ path: '/view2', component: View2 },
{ path: '*', redirect: '/' },
];
export default new Router ({
mode: 'history',
linkActiveClass: 'active',
routes,
});

0 comments on commit b73662a

Please sign in to comment.