一开始需要实现的功能是跳转到一个页面然后传入一个产品ID号,然后在目标页面用这个ID号显示具体的产品信息我是用的方法是在template中使用router-link标签<router-link to="/product"> <a @click=“routerTo(productId)” href="#">{{ item.name }}</a> </router-link>//将 productId 传入 /product 页面routerTo():routerTo(index){ this.$router.push({ name:‘product’,params:{productId:index}});}//在product页面中可以直接使用productId属性了上面的router-link方法是完全错误的,想要传参数这种方法确实可以传过去,但是只要页面刷新,参数就会消失!所以要把router-link改为:<router-link :to="{name:‘product’}"> <a @click=“routerTo(productId)” href="#">{{ item.name }}</a> </router-link>