关于vue-router 的配置

 1 //代码要写在router文件夹下的index.js中

import Vue from 'vue' 2 import Router from 'vue-router' 3 import goods from '../components/goods/goods.vue' 4 import ratings from '../components/ratings/ratings.vue' 5 import seller from '../components/seller/seller.vue' 8 9 11 Vue.use(Router) 12 13 const router = new Router({ 14 linkActiveClass: 'className', // 将'className'设置为默认样式 https://router.vuejs.org/zh-cn/api/options.html#base 15 routes: [ 16 { path: '/goods', component: goods }, 24 { path: '/ratings', component: ratings }, 25 { path: '/seller', component: seller } 26 ] 27 }) 28 29 new Vue({ 30 router 31 }).$mount('#app') 32 router.push('/goods') 33 34 export default router; //必须有

 

转载于:https://www.cnblogs.com/footstep/p/7930131.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值