老师,你的这个 vue-router 是 旧版本的,请问2.0版本的代码怎么实现?
来源:

捞拉
2016-11-19
老师,你的这个 vue-router 是 旧版本的,请问2.0版本的代码怎么实现?
7回答
-
ustbhuangyi
2016-11-19
目前课程是基于 Vue 1.0 版本的,所以 Vue-router 也是 0.7 版本。如果使用 Vue 2.0 开发,可以使用 Vue-router 2.0,和 1.0 的差别并不会太大~具体建议参考官网文档~
042016-11-29 -
Simon_ITer
2017-01-25
我用vue2.0写了一个饿了么点餐系统的Demo,关于vue的一些基本用法都有用到,并且引入了vuex、vue-router、axios、webpack、eslint、better-scroll等,感兴趣可以来看看
https://github.com/SimonZhangITer/VueDemo_Sell_Eleme
20 -
潇11
2016-12-04
2.0 Vue-router的实现代码
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); const routes = [ { path: '/goods', component: goods }, { path: '/ratings', component: ratings }, { path: '/seller', component: seller } ]; const router = new VueRouter({ linkActiveClass: 'active', routes }) /* eslint-disable no-new */ new Vue({ template: '<App/>', components: { App }, router: router }).$mount('#app'); router.push('/goods');
212017-01-04 -
野蛮生长的草
2017-03-03
老师,安装好stylus-loader后提示 ERROR in Cannot find module 'stylus' 根据提示似乎是stylus这个模块无法找到,于是我又全局npm install -g stylus 之后重新运行代码还是报上面的错误。请问是什么原因?????
00 -
雪碧爹
2017-02-09
老师,什么时候会更新为2.0啊
00 -
ai7hoo
2016-12-04
我也是直接使用的2.0的版本,这是我得实现。https://github.com/ai7hoo/sell/blob/master/src/main.js
00 -
无人no1
2016-12-02
我vue用的是2.0 vue-router 也是用的2.0 的 api有点差别 这是我的代码: https://github.com/johnnyWu1/vue_sell_app (57%)
012016-12-05
相似问题