VUE带参跳转页面

第一个页面

//点击按钮执行函数
 gourl(){
      this.$router.push({
          path: '/demo2-page5',
          // name: 'mallList',
          query: {
            pkid: this.pkid
          }
        })

第二个页面

//页面加载此函数
 getParams() {
      //取到路由带过来的参数
      this.pkid = this.$route.query.pkid;
    }

猜你喜欢

转载自blog.csdn.net/qq_39072819/article/details/103849308