1.首先定义跳转函数

这个是链接跳转

<a href="javascript:void(0)" onclick="openPage()">位移变化趋势图</a></td></tr>
</table>
 methods: {
openPage(){
// this.$router.push('/dis/show');
this.$router.push({path: '/dis/show',
query: {
searchObj: { type:"monitoring1" ,data:"data_real",begin:"2018-12-20",end:"2018-12-29"}
}
});

2.跳转页面接收参数

 data() {
return {
searchObj:{},
btnDisabled:false
}
},
created(){
this.getParams(),
this.showChart()
},
methods:{
getParams(){
// 取到路由带过来的参数赋值给searchObj
this.searchObj = this.$route.query.searchObj
},

3.跳转后直接执行方法

vue跳转页面携带参数并且立即执行方法_赋值


就是在跳转页面直接执行

新创建一个公众号 Rockey小何同学 想相互交流的同学可以关注一下哈! 感谢支持!