不会在地址栏显示参数: 传值时:使用name搭配params使用; 取值时:使用this.$route.params去获取参数
this.$router.push({
name:'vote-application.vote.createDetail',
params:{id:this.id,from:"nopermission",isInvited:this.isInvited}
})
let p = this.$route.params
if(Object.keys(p).length) {
this.id = p.id
}
参数会直接显示在地址栏:如 ?id=xx: 传值时:使用path搭配query使用; 取值时:使用this.$route.query去获取参数
this.$router.push({
path:'/vote-application/vote/joinDetail',
query:{id:item.id,isInvited:true}
})
let q = this.$route.query
if(Object.keys(q).length) {
this.id = q.id
}