- 6
- 0
- 约1.09万字
- 约 30页
- 2026-03-05 发布于四川
- 举报
2025年小程序开发工程师试题及答案
一、选择题(每题3分,共30分)
1.以下关于微信小程序生命周期的描述,错误的是()
A.App()实例的onLaunch方法在小程序初始化完成时触发,全局只触发一次
B.Page()实例的onShow方法在页面显示/切入前台时触发,每次页面出现都会执行
C.当小程序进入后台运行时,App()实例的onHide方法会被调用,此时所有页面的定时器都会被暂停
D.Page()实例的onUnload方法在页面卸载时触发,页面跳转至tabBar页面时会执行该方法
2.小程序中使用wx.createSelectorQuery()获取节点信息时,以下哪种写法能正确在自定义组件中获取当前组件内的节点()
A.wx.createSelectorQuery().select(.target).boundingClientRect()
B.this.createSelectorQuery().select(.target).boundingClientRect()
C.wx.createSelectorQuery().in(this).select(.target).boundingClientRect()
D.this.createSelectorQuery().in(this).select(.ta
原创力文档

文档评论(0)