美文网首页
2019-09-28关于小程序this.setData无法账号函

2019-09-28关于小程序this.setData无法账号函

作者: 左子穆 | 来源:发表于2019-09-28 22:21 被阅读0次

    VM1315:1 thirdScriptError
    sett is not defined;at api request success callback function
    ReferenceError: sett is not defined
    at success (http://127.0.0.1:38477/appservice/page/list/list.js:64:9)
    at Object.o.<computed> (WAService.js:1:1131034)
    at WAService.js:1:453704
    at MC (WAService.js:1:1091186)
    at Function.success (WAService.js:1:1092853)
    at WAService.js:1:102995
    at C (WAService.js:1:437200)
    at i.<anonymous> (WAService.js:1:705916)
    at i.emit (WAService.js:1:462750)
    at Ws (WAService.js:1:706524)

    解决方案
    函数中增加相应的临时变量存取this当前对象,至此可以后续回调函数中全局使用。
    例如:
    var self = this
    使用
    self.setData() 就可以正常使用。

    参考案例:
    https://www.qinziheng.com/xiaochengxudev/5791.htm

    相关文章

      网友评论

          本文标题:2019-09-28关于小程序this.setData无法账号函

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