传参组件

一、

<router-link :to='"/main/course?navName=" +item.columnName + "& + (item.cateSysId?item.cateSysId:-1)'></router-link>

接收参数

data(){

  return{

    titleName:this.$route.query.navName,

    navName:this.$toute.query.navName,

    id:this.$route.query.id,

    cid:this.$route.query.cid

  }

}

 二、

注意:是name和params,其中name是router下index.js定义路由时的name

this.$router.push({
  name: 'xxx',
  params: {
    a: 'xxx',
    b: 'xxxx'
  }
})

接收参数:this.$route.params.a

三、

this.$router.push({
  path: 'xxx',
  query: {
    a: 'xxx',
    b: 'xxxx'
  }
})

接收参数:this.$route.query.a

相关文章:

  • 2022-03-09
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案