MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / getRect

Method getRect

mini_program/common/Tools.js:644–658  ·  view source on GitHub ↗

* 查询节点信息 * 当前方法在支付宝小程序中无法获取组件跟接点的尺寸 * 解决办法:为组件根部再套一个没有任何作用的view元素

(selector, all)

Source from the content-addressed store, hash-verified

642 * 解决办法:为组件根部再套一个没有任何作用的view元素
643 */
644 getRect(selector, all) {
645 return new Promise((resolve) => {
646 wx.createSelectorQuery()
647 .in(this)[all ? 'selectAll' : 'select'](selector)
648 .boundingClientRect(rect => {
649 if (all && Array.isArray(rect) && rect.length) {
650 resolve(rect)
651 }
652 if (!all && rect) {
653 resolve(rect)
654 }
655 })
656 .exec()
657 })
658 }
659
660
661 renderUrl(url, defaultUrl) {

Callers 7

LxFunction · 0.80
LMFunction · 0.80
nIFunction · 0.80
echarts.jsFile · 0.80
sOFunction · 0.80
GNFunction · 0.80
iEFunction · 0.80

Calls 1

isArrayMethod · 0.80

Tested by

no test coverage detected