MCPcopy Create free account
hub / github.com/CoderOpen/waimai / getRect

Function getRect

front/wxcomponents/vant/mixins/basic.js:6–20  ·  view source on GitHub ↗
(selector, all)

Source from the content-addressed store, hash-verified

4 this.triggerEvent(...args);
5 },
6 getRect(selector, all) {
7 return new Promise(resolve => {
8 wx.createSelectorQuery()
9 .in(this)[all ? 'selectAll' : 'select'](selector)
10 .boundingClientRect(rect => {
11 if (all && Array.isArray(rect) && rect.length) {
12 resolve(rect);
13 }
14 if (!all && rect) {
15 resolve(rect);
16 }
17 })
18 .exec();
19 });
20 }
21 }
22});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected