cxc-szcx-uniapp/uni_modules/lime-shared/getRect/uvue.uts
2025-02-11 17:09:35 +08:00

16 lines
547 B
Plaintext

// @ts-nocheck
export function getRect(selector : string, context: ComponentPublicInstance):Promise<NodeInfo> {
return new Promise((resolve)=>{
uni.createSelectorQuery().in(context).select(selector).boundingClientRect(res =>{
resolve(res as NodeInfo)
}).exec();
})
}
export function getAllRect(selector : string, context: ComponentPublicInstance):Promise<NodeInfo[]> {
return new Promise((resolve)=>{
uni.createSelectorQuery().in(context).selectAll(selector).boundingClientRect(res =>{
resolve(res as NodeInfo[])
}).exec();
})
}