MCPcopy
hub / github.com/youzan/vant-weapp / getRect

Function getRect

packages/common/utils.ts:54–67  ·  view source on GitHub ↗
(
  context: WechatMiniprogram.Component.TrivialInstance,
  selector: string
)

Source from the content-addressed store, hash-verified

52}
53
54export function getRect(
55 context: WechatMiniprogram.Component.TrivialInstance,
56 selector: string
57) {
58 return new Promise<WechatMiniprogram.BoundingClientRectCallbackResult>(
59 (resolve) => {
60 wx.createSelectorQuery()
61 .in(context)
62 .select(selector)
63 .boundingClientRect()
64 .exec((rect = []) => resolve(rect[0]));
65 }
66 );
67}
68
69export function getAllRect(
70 context: WechatMiniprogram.Component.TrivialInstance,

Callers 15

setLeftFunction · 0.90
getChildWrapperStyleFunction · 0.90
setAnchorsRectFunction · 0.90
setListRectFunction · 0.90
setSiderbarRectFunction · 0.90
getAnchorRectFunction · 0.90
setHeightFunction · 0.90
scrollIntoViewFunction · 0.90
onTouchMoveFunction · 0.90
onClickFunction · 0.90
onScrollFunction · 0.90
setHeightFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected