码迷,mamicode.com
首页 > 其他好文 > 详细

vue路由跳转

时间:2020-11-20 12:19:49      阅读:19      评论:0      收藏:0      [点我收藏+]

标签:pat   成功   turn   message   path   return   type   页面   The   

// 保存
    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: ‘保存失败‘
        })
      })
    }

vue路由跳转

标签:pat   成功   turn   message   path   return   type   页面   The   

原文地址:https://www.cnblogs.com/yxyuanxiang/p/13985107.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!