收藏
回答

wx.getLocation success函数里为什么不能setData?

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.getLocation 工具 6.5.3 2.2.5


wx.getLocation({

type: 'gcj02',

success(res) {


this.setData({

latitude:res.latitude

})

}

})


回答关注问题邀请回答
收藏

1 个回答

  • 灵芝
    灵芝
    2019-01-07

    这样写试试


    2019-01-07
    有用
    回复 4
    • 2019-01-07

      谢谢 我试试

      2019-01-07
      回复
    • 2019-01-07

      还是不行

      2019-01-07
      回复
    • 灵芝
      灵芝
      2019-01-07回复

      麻烦提供出现问题的机型和微信版本,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

      2019-01-07
      回复
    • 2019-01-12回复灵芝

      作用域问题

      let that = this; 或者用箭头函数

      2019-01-12
      回复
登录 后发表内容