真机测试画布getContext('2d')无法使用?

发布于 6 年前作者 yangguiying11299 次浏览最后编辑 6 年前来自 issues
wx.createSelectorQuery()
      .select('#myCanvas')
      .fields({
        node:true,
        size:true,
      })
      .exec((res) => {
        console.log(res[0])
      })

fields中读取node真机返回错误

Uncaught (in promise) ReferenceError: NativeGlobal is not defined
    at n.value ([publib]:1)
    at n.value ([publib]:1)
    at t ([publib]:1)
    at n.value ([publib]:1)
    at eval ([publib]:1)
    atnew Promise (<anonymous>)
    at t ([publib]:1)
    at eval ([publib]:1)
    at Array.forEach (<anonymous>)
    at eval ([publib]:1)

这是什么原因呢?测试机器 小米8、苹果X

2 回复
gaoxiuying
gaoxiuying1 楼6 年前

感谢反馈,目前真机调试不支持直接获取 Canvas 的 context,现在可以以预览为准。请期待后续更新。

qiangkang
qiangkang2 楼4 年前

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