码迷,mamicode.com
首页 > 其他好文 > 详细

vue路由的使用

时间:2018-09-28 16:37:44      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:path   city   iconfont   his   div   javascrip   font   highlight   home   

//配置路由
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路由的使用

标签:path   city   iconfont   his   div   javascrip   font   highlight   home   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!