vue 中路径props的传参

第一种:单一参数

{
path: '/news/:id', //模板props中也需要是id
props:true,
name:news,
component: news
}
vue 中路径props的传参
vue 中路径props的传参

第二种:多个参数

{
      path: '/news/:id',
      props:function(route){
        console.log(route);
        return {
          id:route.params.id,
          username:route.query.username
        }
      },
      name:news,
      alias:'/self',//别名
      component: news
    },
vue 中路径props的传参
vue 中路径props的传参
VUE前端技术

vue路由守卫(路由事件)的两种方式

2020-5-27 22:20:45

前端技术行业动态

前端开发者不得不知道的18个常用的网站

2020-5-27 22:24:32

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索