当需要router-link传递参数的时候 vue2 如何做 记录下来备忘
1、通过vue页面传递参数
<router-link :to="{ path:'./attachment',query:{order_id: task.ORDERID}}"><mt-button type="primary" size="small">查看附件</mt-button></router-link>
2、通过方法传递参数
methods: {
society() {
//console.log('society');
this.$router.push({
name:'society',
query:{value:1}
})
},
3、接值
methods:{
loadData:function(){
this.id = this.$route.query.order_id;
axios.get("http://testqywx.origimed.com:18082/weixin-qy/order/Order/userOrderFilesList.json?usercode=sysadmin&orderId="+this.id)
.then(response=>this.tasks=response.data.reason);
}
},