this.createSelectorQuery在PC端exec时,res中node返回null?
发布于 4 年前 作者 taoguiying 3189 次浏览 来自 官方Issues

小程序组件中使用this.createSelectorQuery,在PC端exec时,res中node返回null,怎么办?【手机端是正常的】

page.wxml 

<canvas type=“2d” id=“canvas” class=“su-gongzhang”></canvas>

page.js

 this.createSelectorQuery()

        .select(’#canvas’)

        .fields({

          node: true,

          size: true

        })

        .exec((res) => {         

          console.log(res)        

        })

    },

在微信PC端(3.2.1.154)的执行时返回的res中node为null,为什么呢?【手机端是正常的】

Array [[object Object]]

0: Object

height: 200

node: null

nodeCanvasType: “2d”

width: 200

__proto__: Object

1 回复

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

回到顶部