1.route-link标签里写法
<route-link :to ="{path:'/profile',query:{name:'张三',height:1.63,age:18}}"></route-link>
2.点击事件传参
<button @click="toProfile">档案</button> 方法里: methods:{ toProfile( this.$router.push({ path:'/profile', query:{ name:'张三', age:18 } }) }
}
接收参数方法:
this.name=this.$route.query.name
this.age=this.$route.query.age