在js中实现vue从一个页面跳转到另一个页面并携带参数

courseSave () {
  // console.log(this.obj)
  this.obj.description = this.editor2.txt.html();
  console.log(this.obj)
  var that=this;
  this.$http.post("http://localhost:9101/course/addCourse",this.obj).then(function (resp) {
    if(resp.data.code===2000){
      that.$message.success(resp.data.msg)
===================================跳转代码===================================
      that.$router.push({
        path: 'UploadChapterContent',
        query: {
          id: resp.data.result
        }
      })
=============================================================================
      //console.log(that.subjectData)
    }else {
      that.$message.error(resp.data.msg)
    }
  })

中点击实现跳转可见vue路由router携参跳转页面方式

你可能感兴趣的:(web开发过程中总结,js,vue)