业务需求

此vue页面的一个按钮点击后,跳转至另一个vue页面的某个点击事件对应的窗口。

解决方案:

第一步:
起始的vue页面:增加一个路由跳转方法并传参

 methods: {
      goto:function(pesrsonName) {

        this.$router.push({
                    path: 'taskDistribution',
                    // name: 'mallList',
                  query: {
                   id:pesrsonName
                  }
               })

      },
      }

第二步:
跳转后的vue页面:

 created: function() {
      window.that = this
      this.getParams()
    },

然后methods中增加相应方法:

methods: {
      getParams(){
        const routerParams = this.$route.query.id;
        console.log(routerParams);
        if (routerParams!=null){
          // this.addData()
          this.modal=true;
          this.detail.inspector=routerParams;
        }
      },
      }
Logo

前往低代码交流专区

更多推荐