本文跳转传参用的是:this.$router.push

1、首先定义好要跳转的页面(跳转到MonitoringDetails)以及传递的参数(benid2就是要传递的参数)。

  goMonitoringDetails() {
      this.$router.push({ 
        name: "MonitoringDetails",     //跳转的页面
        params:{
          "benid2":this.currentData.benid2        //我们要传递的参数
          } 
        });
    }

2、在另一个页面(MonitoringDetails)接收。

  getParams(){
        var routerParams = this.$route.params.benid2;
        // 将数据放在当前组件的数据内
        this.id = routerParams;
        console.log("我们接收的参数为:"+this.id)   
    },

 

Logo

前往低代码交流专区

更多推荐