vue.js跳转传参(跨页传值)及接收参数

在methods方法里面写点击事件,path:" "里面写出你需要跳转的页面
query里面写出你要传的参数

methods: {
      Ere(){
        this.$router.push({
          path: ' ',    //跳转页面的名字
          query: {
            id: this.id,                   
          }
        })
      }
    },

另外一个页面接收需要:

created:{
this.id = this.$route.query.id;
}

前面的 id 是自己新命名的,后面的id是你上一页命名的

发布了5 篇原创文章 · 获赞 0 · 访问量 200

猜你喜欢

转载自blog.csdn.net/Dream_Fever/article/details/105565386
今日推荐