vue.js Jump pass parameter (cross-page pass value) and receive parameters

Write the click event in the methods method, path: "" Write the page you need to jump to and
write the parameter you want to pass in the query

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

Another page reception needs:

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

The id in the front is newly named by yourself, the id in the back is named on your previous page

Published 5 original articles · Likes0 · Visits200

Guess you like

Origin blog.csdn.net/Dream_Fever/article/details/105565386