首页 > 其他 > 详细

vue路由的使用

时间:2018-09-28 15:41:25      阅读:126      评论:0      收藏:0      [点我收藏+]
//配置路由
Vue.use(Router)

export default new Router({
  routes: [{
      path: ‘/‘,
      name: ‘Home‘,
      component: Home
    },{
      path: ‘/city‘,
      name: ‘City‘,
      component: City
    }]
})

  

//在子组件中使用路由
<router-link to="/city"> //to="/city"  路由的去向
<div class="head-right"> {{this.city}} <span class="iconfont arror-icon"></span> </div> </router-link>

  

vue路由的使用

原文:https://www.cnblogs.com/chenlw/p/9718933.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!