main.js
import Vue from 'vue';
import App from './App';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import goods from './components/goods/goods.vue';
import ratings from './components/ratings/ratings.vue';
import seller from './components/seller/seller.vue';
Vue.use(VueRouter);
Vue.use(VueResource);
/*全局挂载*/
let app=Vue.extend(App);
/*创建路由*/
let router=new VueRouter({
linkActiveClass:'active'
});
/*初始化路由*/
router.map({
'/goods':{
component:goods
},
'/ratings':{
component:ratings
},
'/seller':{
component:seller
}
});
router.start(app,'#app');
打开App,阅读手记