File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11import Vue from 'vue'
22import VueRouter from 'vue-router' ;
33import App from './App.vue'
4- import ProductList from './ProductList.vue' ;
5- import Cart from './Cart.vue' ;
4+ import { routes } from './routes' ;
65
76Vue . use ( VueRouter ) ;
87
98const router = new VueRouter ( {
10- routes : [
11- { path : '' , component : ProductList } ,
12- { path : '/cart' , component : Cart } ,
13- { path : '*' , component : { template : '<h1>Page Not Found!</h1>' } }
14- ] ,
9+ routes : routes ,
1510 mode : 'history'
1611} ) ;
1712
Original file line number Diff line number Diff line change 1+ import ProductList from './ProductList.vue' ;
2+ import Cart from './Cart.vue' ;
3+
4+ export const routes = [
5+ { path : '' , component : ProductList } ,
6+ { path : '/cart' , component : Cart } ,
7+ { path : '*' , component : { template : '<h1>Page Not Found!</h1>' } }
8+ ] ;
You can’t perform that action at this time.
0 commit comments