当前位置:网站首页>微信小程序——在小程序自定义组件中获取元素定位及宽度
微信小程序——在小程序自定义组件中获取元素定位及宽度
2022-07-15 08:14:00 【[email protected]】
在自定义组件中必须要用SelectorQuery.in(),否则无法获取
demo.wxml文件
<image class="publicImg" /></image>
demo.js文件
var query = wx.createSelectorQuery().in(this);
query.select('.publicImg').boundingClientRect()
query.exec(function (res) {
//res就是 所有标签为publicImg的元素的信息 的数组
console.log(res);
})
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_43201350/article/details/125752781
边栏推荐
- What is the relationship between MySQL table space and database?
- 如何启动MySQL?
- redo使用率高处理方案
- Realsense dynamic calibration
- How does Oracle view the database alarm log?
- CNN中的混合域注意力机制CBAM
- Oracle数据存储方式是什么?
- HOWTO make the simulation better
- Basic Mo team - block the inquiry
- The data files of polardb for PostgreSQL are stored in the base directory of the directory where the database is located. How can I check
猜你喜欢

Win11删除英文输入法的方法教程

【趣题分享】关于蒋干盗书你所需要知道的

Yolov3 model structure

idea调试中Step into与Force Step into区别

JVM (XXII) -- performance monitoring and tuning (III) -- JVM monitoring and diagnostic tools -- GUI

Thymeleaf configuration internationalization page

How to set the screen sleep time in win11

Setting method for win11 to create its own log file

Langchao Yunxi distributed database tracing (II) -- source code analysis

指针与数组的复杂纠葛
随机推荐
Quelle est la relation entre l'espace de table d'Oracle et la base de données?
What is the relationship between MySQL table space and database?
Win11语音识别怎么设置关闭?
Wallys/Network card collection QCA9880/QCA9882/QCN9074/QCN9024/QCN9064/MT7915/MT7975
A 27 year old software tester, who has been working for nearly five years with a monthly salary of less than 2W, is worried about being replaced by fresh graduates
PolarDB for PostgreSQL的数据文件存放在数据库所在目录的base目录下。我怎么查
Yanrong full flash x NVIDIA Infiniband: creating a high-performance storage technology for GPU computing in the AI Era
All you want to know about clothing ERP is here
PCL 最远点采样(版本二)
我参加的活动啊啊
List集合
PolarDB for PostgreSQL数据存储方式是什么?
数据库配置白/黑名单
Collection & List 学习
Cfdiv1+2-let them slide- (line segment tree)
海思万能平台搭建:在线调试2ssh的移植部署
[interesting topic sharing] what you need to know about Jiang Gan stealing books
JVM (XXII) -- performance monitoring and tuning (III) -- JVM monitoring and diagnostic tools -- GUI
AccessClient插件在苹果电脑闪退
The data files of polardb for PostgreSQL are stored in the base directory of the directory where the database is located. How can I check