请选择 进入手机版 | 继续访问电脑版
帖子
帖子
用户
博客
课程
显示全部楼层
16
帖子
0
勋章
208
Y币

[云开发] apiready中调用methods中的方法

[复制链接]
发表于 2020-12-23 14:46:57
  if (ret.length > 0) {
                    //doThis(ret);
                    //doThis.click(ret);
                    //this.$options.methods.doThis(ret);
                   this.doThis(ret);
  }
以上是我尝试调动下房methods里的doThis方法写的代码,上面代码全部都在apiready中

    methods: {     
        doThis(msg) {
            api.alert({
                msg: msg.length
            });
            for (var i = 0; i < msg.length; i++) {
                this.jieguo.push(this.msg[i]);
            }
        }
    }

转到微信小程序上运行调试的时候,全部提示doThis未定义


37
帖子
2
勋章
3711
Y币
是不是this指向不对
您需要登录后才可以回帖 登录

本版积分规则