index页面
1.params
this.$router.push()方法中path不能与params同用,否则param会失效,所以用name来指定页面,params来传递数据内容。

<template> <img src="../../static/images/indexTermianal/teacher.png" alt="" @click ="go()" > </template> <script> methods:{ go:function(){ this.$router.push({ name:'indext', params:{ userId:1 } }) } } </script>

在目标页面通过this.$route.params获取参数:
  <p>{{this.$route.params.userId}}</p>   2.query 页面通过path和query传递参数,该实例中row为某行表格数据 methods:{ go:function(){ this.$router.push({ path:'/indext', query:{ userId:1 } }) } }, 目标页面this.$route.query.userId获取数据 <p>{{this.$route.query.userId}}</p>

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。