代码不走首页的onLoad方法,求助,为什么?

小程序 文章 2020-08-12 17:01 468 0 全屏看文

AI助手支持GPT4.0

代码不走首页的onLoad方法,求助,为什么?The code does not follow the onLoad method of the homepage, please help, why?

代码不走首页的onLoad方法,求助,为什么?

最新版本开发者工具,项目启动后首页不走onLoad,导致初始化数据拿不到,我把代码复制到另一个小程序工程里面重新启动就可以走,这是为什么呢?我做了测试把首页地址换成另一个页面,发现不管设置哪个页面是首页,首页的onLoad都不走。求助,有人遇到过吗?

The latest version of the developer tool does not use onload on the home page after the project is started, which results in missing initialization data. I copy the code to another small program project and restart it. Why? I did a test to change the home page address to another page, and found that no matter which page is the home page, the onload of the home page does not go. Have you met anyone for help?

回答:

社区技术运营专员-CJiang:

麻烦提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

?:

贴下onload 看下你怎么写的。

Distance:

开发版工具还是?版本号呢?

自由狂:最新版(1.03.2008102)  昨天刚更新的,然后就出现了这个问题。。。与更新有关吗?
Distance:下载稳定版看看
Allen:

方便贴一下代码吗? 是否在首页中使用了组件 组件中的onload不走

自由狂:代码是没有问题的,重新打开一个项目,把代码复制过去,就能走,大佬知道是为什么吗?
黄秀杰:敲下一行debugger;看断不断点?
自由狂:不断
自由狂:是不是小程序哪里有设置,我不小心点到了

-EOF-

AI助手支持GPT4.0