vue路由跳转

// 保存
    saveData() {
      teacher.save(this.teacher).then(response => {
        return this.$message({
          type: 'success',
          message: '保存成功!'
        })
      }).then(resposne => {
        // 路由跳转,添加完成后跳转到列表页面
        this.$router.push({ path: '/edu/teacher' })
      }).catch((response) => {
        // console.log(response)
        this.$message({
          type: 'error',
          message: '保存失败'
        })
      })
    }

取自谷粒学院项目

posted @ 2020-11-16 15:03  yx袁祥  阅读(94)  评论(0)    收藏  举报