1.params传参,地址栏不会暴露参数,比较安全
handleDetail(row){//查看明细,name是router中要跳转页面的名字
this.$router.push({name: "pendDetails",params: { orderId: row.orderId },});
},
接参:
created() {
this.queryParams.orderId = this.$route.params && this.$route.params.orderId;
},
2.query,地址参数可见,安全性差
handleDetail(row){//查看明细,name是router中要跳转页面的名字
this.$router.push({path: "pendDetails",query: { orderId: row.orderId },});
},
接参:
created() {
this.queryParams.orderId = this.$route.query&& this.$route.query.orderId;
},
3.router-link标签,一般以上两种够用,想学习的百度去吧。
记得name/path,一定要和router中一致才行哦!