美文网首页
vue控制台报 Uncaught (in promise) Ty

vue控制台报 Uncaught (in promise) Ty

作者: 小话梅噢 | 来源:发表于2019-02-28 01:41 被阅读0次

1、使用的参数可能是null,undefined。

2、返回的参数有重复。

3、未捕获异常。

处理方法

getList() {

      this.$http({

        method: 'post',

        url: '/flow/instance/list',

        options: {

          noParam: true

        },

        data: this.params

      }).then(data => {

        if (data.success) {

          this.list = data.data.rows;

          this.total = data.data.total;

          this.list.forEach(item => {

            let temp = JSON.parse(item.variable);

            if (temp.ApplyParams.remark.length>=0) {//确保使用的参数不是null和undefined

              item.remark =temp.ApplyParams.remark;

            }

          })

        }

      }).catch(() => console.log('promise catch err')); //捕获异常

    },

相关文章

网友评论

      本文标题:vue控制台报 Uncaught (in promise) Ty

      本文链接:https://www.haomeiwen.com/subject/gwdcuqtx.html