selectcomponent 返回null

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:19 732 0 全屏看文

AI助手支持GPT4.0

selectcomponent 返回null
框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 微信安卓客户端 7.0.17 2.12.0

我有一个自定义组件naid,在index.wxml中,有四个naid节点,各自具有一个互不相同的id,我查看节点树,能看到四个naid节点的,id也各自不一样,但是this.selectcomponent 只能查找其中三个,剩下那一个,总是返回null.不是必现的问题,但是每次出现,几乎都是一样的现象,只不过有的时候是第一个naid节点,有的时候是第二个,有的时候是第三个,有的时候是第四个

Framework type problem type terminal type wechat version basic library version applet bug wechat Android client 7.0.17 2.12.0 I have a custom component named naid index.wxml In, there are four naid nodes, each with a different ID. when I look at the node tree, I can see the, ID is different, but this.selectcomponent Only three of them can be found, and the remaining one always returns null. It is not a necessary problem, but every time it appears, it is almost the same phenomenon, except that sometimes it is the first naid node, sometimes it is the second node, sometimes it is the third node, and sometimes it is the fourth one

回答:

袁Z鹏:

弄个代码段出来瞧一瞧

-EOF-

AI助手支持GPT4.0